mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-14 21:27:23 +01:00
fix exports
This commit is contained in:
@@ -41,7 +41,7 @@ import axios from 'axios';
|
||||
import Avatar from '../avatar';
|
||||
import { mapState } from '@/libs/store';
|
||||
import percent from '@/../../common/script/libs/percent';
|
||||
import {maxHealth} from '@/../../common/script/index';
|
||||
import {MAX_HEALTH as maxHealth} from '@/../../common/script/constants';
|
||||
import revive from '@/../../common/script/ops/revive';
|
||||
|
||||
export default {
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
<script>
|
||||
import { mapState } from '@/libs/store';
|
||||
import eggs from '@/../../common/script/content/eggs';
|
||||
import * as eggs from '@/../../common/script/content/eggs';
|
||||
|
||||
export default {
|
||||
data () {
|
||||
|
||||
@@ -116,7 +116,7 @@
|
||||
<script>
|
||||
import Avatar from '../avatar';
|
||||
import { mapState } from '@/libs/store';
|
||||
import {maxHealth} from '@/../../common/script/index';
|
||||
import {MAX_HEALTH as maxHealth} from '@/../../common/script/constants';
|
||||
import styleHelper from '@/mixins/styleHelper';
|
||||
import twitter from '@/assets/svg/twitter.svg';
|
||||
import facebook from '@/assets/svg/facebook.svg';
|
||||
|
||||
@@ -53,7 +53,7 @@ b-modal#login-incentives(:title="data.message", size='md', :hide-footer="true")
|
||||
<script>
|
||||
import { mapState } from '@/libs/store';
|
||||
import Avatar from '../avatar';
|
||||
import {loginIncentives} from '@/../../common/script/content/index';
|
||||
import content from '@/../../common/script/content/index';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -62,7 +62,7 @@ export default {
|
||||
props: ['data'],
|
||||
data () {
|
||||
return {
|
||||
loginIncentives,
|
||||
loginIncentives: content.loginIncentives,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
import Avatar from '../avatar';
|
||||
import { mapState } from '@/libs/store';
|
||||
import percent from '@/../../common/script/libs/percent';
|
||||
import {maxHealth} from '@/../../common/script/index';
|
||||
import {MAX_HEALTH as maxHealth} from '@/../../common/script/constants';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
||||
@@ -23,12 +23,12 @@
|
||||
</style>
|
||||
|
||||
<script>
|
||||
import quests from '@/../../common/script/content/quests';
|
||||
import * as quests from '@/../../common/script/content/quests';
|
||||
import questDialogDrops from '@/components/shops/quests/questDialogDrops';
|
||||
|
||||
import { mapState } from '@/libs/store';
|
||||
import percent from '@/../../common/script/libs/percent';
|
||||
import { maxHealth } from '@/../../common/script/index';
|
||||
import {MAX_HEALTH as maxHealth} from '@/../../common/script/constants';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
||||
@@ -45,10 +45,10 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import quests from '@/../../common/script/content/quests';
|
||||
import * as quests from '@/../../common/script/content/quests';
|
||||
import { mapState } from '@/libs/store';
|
||||
import percent from '@/../../common/script/libs/percent';
|
||||
import {maxHealth} from '@/../../common/script/index';
|
||||
import {MAX_HEALTH as maxHealth} from '@/../../common/script/constants';
|
||||
|
||||
export default {
|
||||
data () {
|
||||
|
||||
@@ -709,7 +709,7 @@ import map from 'lodash/map';
|
||||
import { mapState } from '@/libs/store';
|
||||
import avatar from './avatar';
|
||||
import usernameForm from './settings/usernameForm';
|
||||
import { getBackgroundShopSets } from '@/../../common/script/libs/shops';
|
||||
import shops from '@/../../common/script/libs/shops';
|
||||
import guide from '@/mixins/guide';
|
||||
import notifications from '@/mixins/notifications';
|
||||
import toggleSwitch from '@/components/ui/toggleSwitch';
|
||||
@@ -754,7 +754,7 @@ export default {
|
||||
this.$root.$on('buyModal::boughtItem', this.backgroundPurchased);
|
||||
},
|
||||
data () {
|
||||
let backgroundShopSets = getBackgroundShopSets();
|
||||
let backgroundShopSets = shops.getBackgroundShopSets();
|
||||
|
||||
return {
|
||||
loading: false,
|
||||
|
||||
@@ -135,7 +135,7 @@
|
||||
|
||||
<script>
|
||||
import { mapState, mapGetters } from '@/libs/store';
|
||||
import quests from '@/../../common/script/content/quests';
|
||||
import * as quests from '@/../../common/script/content/quests';
|
||||
|
||||
import copyIcon from '@/assets/svg/copy.svg';
|
||||
import greyBadgeIcon from '@/assets/svg/grey-badge.svg';
|
||||
|
||||
@@ -163,27 +163,27 @@ sidebar-section(:title="$t('questDetailsTitle')")
|
||||
|
||||
span {
|
||||
margin-top: .3em;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.accept, .reject {
|
||||
padding: .2em 1em;
|
||||
font-size: 12px;
|
||||
height: 24px;
|
||||
border-radius: 2px;
|
||||
border-radius: 2px;
|
||||
box-shadow: 0 2px 2px 0 rgba(26, 24, 29, 0.16), 0 1px 4px 0 rgba(26, 24, 29, 0.12);
|
||||
}
|
||||
|
||||
.accept {
|
||||
background-color: #24cc8f;
|
||||
margin-left: 4em;
|
||||
background-color: #24cc8f;
|
||||
margin-left: 4em;
|
||||
margin-right: .5em;
|
||||
}
|
||||
|
||||
.reject {
|
||||
border-radius: 2px;
|
||||
background-color: #f74e52;
|
||||
border-radius: 2px;
|
||||
background-color: #f74e52;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -191,7 +191,7 @@ sidebar-section(:title="$t('questDetailsTitle')")
|
||||
<script>
|
||||
import { mapState } from '@/libs/store';
|
||||
|
||||
import quests from '@/../../common/script/content/quests';
|
||||
import * as quests from '@/../../common/script/content/quests';
|
||||
import percent from '@/../../common/script/libs/percent';
|
||||
import sidebarSection from '../sidebarSection';
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@
|
||||
import { mapState } from '@/libs/store';
|
||||
import * as Analytics from '@/libs/analytics';
|
||||
|
||||
import quests from '@/../../common/script/content/quests';
|
||||
import * as quests from '@/../../common/script/content/quests';
|
||||
|
||||
import copyIcon from '@/assets/svg/copy.svg';
|
||||
import greyBadgeIcon from '@/assets/svg/grey-badge.svg';
|
||||
|
||||
@@ -458,7 +458,7 @@ import tierMod from '@/assets/svg/tier-mod.svg';
|
||||
import tierNPC from '@/assets/svg/tier-npc.svg';
|
||||
import tierStaff from '@/assets/svg/tier-staff.svg';
|
||||
|
||||
import quests from '@/../../common/script/content/quests';
|
||||
import * as quests from '@/../../common/script/content/quests';
|
||||
import staffList from '../../libs/staffList';
|
||||
|
||||
export default {
|
||||
|
||||
@@ -111,9 +111,9 @@ import each from 'lodash/each';
|
||||
import markdownDirective from '@/directives/markdown';
|
||||
import styleHelper from '@/mixins/styleHelper';
|
||||
import { mapState } from '@/libs/store';
|
||||
import quests from '@/../../common/script/content/quests';
|
||||
import * as quests from '@/../../common/script/content/quests';
|
||||
import { mountInfo, petInfo } from '@/../../common/script/content/stable';
|
||||
import { food, hatchingPotions, special } from '@/../../common/script/content';
|
||||
import content from '@/../../common/script/content';
|
||||
import gear from '@/../../common/script/content/gear';
|
||||
import notifications from '@/mixins/notifications';
|
||||
import userLink from '../userLink';
|
||||
@@ -133,9 +133,9 @@ export default {
|
||||
quests,
|
||||
mountInfo,
|
||||
petInfo,
|
||||
food,
|
||||
hatchingPotions,
|
||||
special,
|
||||
food: content.food,
|
||||
hatchingPotions: content.hatchingPotions,
|
||||
special: content.special,
|
||||
gear,
|
||||
expandItems: false,
|
||||
expandAuth: false,
|
||||
|
||||
@@ -22,7 +22,7 @@ base-notification(
|
||||
<script>
|
||||
import BaseNotification from './base';
|
||||
import { mapState } from '@/libs/store';
|
||||
import quests from '@/../../common/script/content/quests';
|
||||
import * as quests from '@/../../common/script/content/quests';
|
||||
import questInfo from '@/components/shops/quests/questInfo';
|
||||
|
||||
export default {
|
||||
|
||||
@@ -134,7 +134,7 @@ base-notification(
|
||||
</style>
|
||||
|
||||
<script>
|
||||
import quests from '@/../../common/script/content/quests';
|
||||
import * as quests from '@/../../common/script/content/quests';
|
||||
|
||||
import { mapState } from '@/libs/store';
|
||||
import BaseNotification from './base';
|
||||
|
||||
@@ -72,7 +72,7 @@ menu-dropdown.item-notifications(:right="true", @toggled="handleOpenStatusChange
|
||||
|
||||
<script>
|
||||
import { mapState, mapActions } from '@/libs/store';
|
||||
import quests from '@/../../common/script/content/quests';
|
||||
import * as quests from '@/../../common/script/content/quests';
|
||||
import notificationsIcon from '@/assets/svg/notifications.svg';
|
||||
import MenuDropdown from '../ui/customMenuDropdown';
|
||||
import MessageCount from './messageCount';
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
import { mapState } from '@/libs/store';
|
||||
import ShopItem from '../shopItem';
|
||||
|
||||
import count from '@/../../common/script/count';
|
||||
import { beastCount, mountMasterProgress } from '@/../../common/script/count';
|
||||
|
||||
import notifications from '@/mixins/notifications';
|
||||
|
||||
@@ -147,10 +147,10 @@ export default {
|
||||
computed: {
|
||||
...mapState({user: 'user.data'}),
|
||||
userHasAllPets () {
|
||||
return count.beastCount(this.user.items.pets) === 90;
|
||||
return beastCount(this.user.items.pets) === 90;
|
||||
},
|
||||
userHasAllMounts () {
|
||||
return count.mountMasterProgress(this.user.items.mounts) === 90;
|
||||
return mountMasterProgress(this.user.items.mounts) === 90;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
||||
@@ -177,7 +177,7 @@ import Drawer from '@/components/ui/drawer';
|
||||
import MouseMoveDirective from '@/directives/mouseposition.directive';
|
||||
|
||||
import mana from '@/assets/svg/mana.svg';
|
||||
import quests from '@/../../common/script/content/quests';
|
||||
import * as quests from '@/../../common/script/content/quests';
|
||||
import { CONSTANTS, setLocalSetting, getLocalSetting } from '@/libs/userlocalManager';
|
||||
|
||||
export default {
|
||||
|
||||
@@ -250,4 +250,4 @@ each(achievementsData, (value, key) => {
|
||||
value.key = key;
|
||||
});
|
||||
|
||||
module.exports = achievementsData;
|
||||
export default achievementsData;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import prefill from '../prefill.js';
|
||||
|
||||
module.exports = prefill({
|
||||
export default prefill({
|
||||
0: {},
|
||||
1: {},
|
||||
2: {},
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import prefill from '../prefill.js';
|
||||
import sets from '../sets.js';
|
||||
|
||||
module.exports = prefill({
|
||||
export default prefill({
|
||||
0: {},
|
||||
1: {},
|
||||
2: {price: 2, set: sets.baseHair1},
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import sets from '../sets.js';
|
||||
import prefill from '../prefill.js';
|
||||
|
||||
module.exports = prefill({
|
||||
export default prefill({
|
||||
0: {},
|
||||
1: {price: 2, set: sets.facialHair},
|
||||
2: {price: 2, set: sets.facialHair},
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import sets from '../sets.js';
|
||||
import prefill from '../prefill.js';
|
||||
|
||||
module.exports = prefill({
|
||||
export default prefill({
|
||||
white: {},
|
||||
brown: {},
|
||||
blond: {},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import prefill from '../prefill.js';
|
||||
|
||||
module.exports = prefill({
|
||||
export default prefill({
|
||||
0: {},
|
||||
1: {},
|
||||
2: {},
|
||||
|
||||
@@ -5,7 +5,7 @@ import color from './color.js';
|
||||
import flower from './flower.js';
|
||||
import mustache from './mustache.js';
|
||||
|
||||
module.exports = {
|
||||
export default {
|
||||
color,
|
||||
base,
|
||||
bangs,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import sets from '../sets.js';
|
||||
import prefill from '../prefill.js';
|
||||
|
||||
module.exports = prefill({
|
||||
export default prefill({
|
||||
0: {},
|
||||
1: {price: 2, set: sets.facialHair},
|
||||
2: {price: 2, set: sets.facialHair},
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import prefill from '../prefill.js';
|
||||
import sets from '../sets.js';
|
||||
|
||||
module.exports = prefill({
|
||||
export default prefill({
|
||||
0: {},
|
||||
1: {price: 2, set: sets.topHair},
|
||||
2: {price: 2, set: sets.topHair},
|
||||
|
||||
@@ -31,4 +31,4 @@ let appearances = {
|
||||
background: reorderedBgs,
|
||||
};
|
||||
|
||||
module.exports = appearances;
|
||||
export default appearances;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import forOwn from 'lodash/forOwn';
|
||||
|
||||
module.exports = function prefillAppearances (obj) {
|
||||
export default function prefillAppearances (obj) {
|
||||
forOwn(obj, function prefillAppearance (value, key) {
|
||||
value.key = key;
|
||||
if (!value.price) {
|
||||
@@ -8,4 +8,4 @@ module.exports = function prefillAppearances (obj) {
|
||||
}
|
||||
});
|
||||
return obj;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import t from '../translation';
|
||||
import prefill from './prefill.js';
|
||||
|
||||
module.exports = prefill({
|
||||
export default prefill({
|
||||
baseHair1: {setPrice: 5, text: t('hairSet1')},
|
||||
baseHair2: {setPrice: 5, text: t('hairSet2')},
|
||||
baseHair3: {setPrice: 5, text: t('hairSet3')},
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import sets from './sets.js';
|
||||
import prefill from './prefill.js';
|
||||
|
||||
module.exports = prefill({
|
||||
export default prefill({
|
||||
black: {},
|
||||
blue: {},
|
||||
green: {},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import prefill from './prefill.js';
|
||||
|
||||
module.exports = prefill({
|
||||
export default prefill({
|
||||
slim: {},
|
||||
broad: {},
|
||||
});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import prefill from './prefill.js';
|
||||
import sets from './sets.js';
|
||||
|
||||
module.exports = prefill({
|
||||
export default prefill({
|
||||
/* eslint-disable quote-props */
|
||||
'ddc994': {},
|
||||
'f5a76e': {},
|
||||
|
||||
@@ -408,7 +408,7 @@ applyEggDefaults(quests, {
|
||||
|
||||
let all = assign({}, drops, quests);
|
||||
|
||||
module.exports = {
|
||||
export {
|
||||
drops,
|
||||
quests,
|
||||
all,
|
||||
|
||||
@@ -25,4 +25,4 @@ for (let i = 0; i <= NUMBER_OF_QUESTIONS; i++) {
|
||||
faq.questions.push(question);
|
||||
}
|
||||
|
||||
module.exports = faq;
|
||||
export default faq;
|
||||
|
||||
@@ -22,4 +22,4 @@ let armor = {
|
||||
armoire: armoireArmor,
|
||||
};
|
||||
|
||||
module.exports = armor;
|
||||
export default armor;
|
||||
|
||||
@@ -9,5 +9,5 @@ let back = {
|
||||
special: specialBack,
|
||||
};
|
||||
|
||||
module.exports = back;
|
||||
export default back;
|
||||
|
||||
|
||||
@@ -11,4 +11,4 @@ let body = {
|
||||
armoire: armoireBody,
|
||||
};
|
||||
|
||||
module.exports = body;
|
||||
export default body;
|
||||
|
||||
@@ -11,4 +11,4 @@ let eyewear = {
|
||||
armoire: armoireEyewear,
|
||||
};
|
||||
|
||||
module.exports = eyewear;
|
||||
export default eyewear;
|
||||
|
||||
@@ -11,5 +11,5 @@ let headAccessory = {
|
||||
armoire: armoireHeadAccessory,
|
||||
};
|
||||
|
||||
module.exports = headAccessory;
|
||||
export default headAccessory;
|
||||
|
||||
|
||||
@@ -22,4 +22,4 @@ let head = {
|
||||
armoire: armoireHead,
|
||||
};
|
||||
|
||||
module.exports = head;
|
||||
export default head;
|
||||
|
||||
@@ -81,7 +81,7 @@ each(GEAR_TYPES, (type) => {
|
||||
});
|
||||
});
|
||||
|
||||
module.exports = {
|
||||
export default {
|
||||
tree: gear,
|
||||
flat,
|
||||
};
|
||||
|
||||
@@ -1713,7 +1713,7 @@ let weapon = {
|
||||
},
|
||||
};
|
||||
|
||||
let armoireSet = {
|
||||
export {
|
||||
armor,
|
||||
body,
|
||||
eyewear,
|
||||
@@ -1721,6 +1721,4 @@ let armoireSet = {
|
||||
headAccessory,
|
||||
shield,
|
||||
weapon,
|
||||
};
|
||||
|
||||
module.exports = armoireSet;
|
||||
};
|
||||
@@ -66,7 +66,7 @@ let weapon = {
|
||||
},
|
||||
};
|
||||
|
||||
let baseSet = {
|
||||
export {
|
||||
armor,
|
||||
back,
|
||||
body,
|
||||
@@ -75,6 +75,4 @@ let baseSet = {
|
||||
headAccessory,
|
||||
shield,
|
||||
weapon,
|
||||
};
|
||||
|
||||
module.exports = baseSet;
|
||||
};
|
||||
@@ -148,11 +148,9 @@ let weapon = {
|
||||
},
|
||||
};
|
||||
|
||||
let healerSet = {
|
||||
export {
|
||||
armor,
|
||||
head,
|
||||
shield,
|
||||
weapon,
|
||||
};
|
||||
|
||||
module.exports = healerSet;
|
||||
};
|
||||
@@ -942,7 +942,7 @@ let weapon = {
|
||||
},
|
||||
};
|
||||
|
||||
let mysterySet = {
|
||||
export {
|
||||
armor,
|
||||
back,
|
||||
body,
|
||||
@@ -951,6 +951,4 @@ let mysterySet = {
|
||||
headAccessory,
|
||||
shield,
|
||||
weapon,
|
||||
};
|
||||
|
||||
module.exports = mysterySet;
|
||||
};
|
||||
@@ -160,11 +160,9 @@ let shield = {
|
||||
},
|
||||
};
|
||||
|
||||
let rogueSet = {
|
||||
export {
|
||||
armor,
|
||||
head,
|
||||
shield,
|
||||
weapon,
|
||||
};
|
||||
|
||||
module.exports = rogueSet;
|
||||
};
|
||||
@@ -2,10 +2,10 @@ import {
|
||||
EVENTS,
|
||||
} from '../../../constants';
|
||||
import { ownsItem } from '../../gear-helper';
|
||||
import backerGear from './special-backer';
|
||||
import contributorGear from './special-contributor';
|
||||
import takeThisGear from './special-takeThis';
|
||||
import wonderconGear from './special-wondercon';
|
||||
import * as backerGear from './special-backer';
|
||||
import * as contributorGear from './special-contributor';
|
||||
import * as takeThisGear from './special-takeThis';
|
||||
import * as wonderconGear from './special-wondercon';
|
||||
import t from '../../../translation';
|
||||
|
||||
const CURRENT_SEASON = 'fall';
|
||||
@@ -5368,7 +5368,7 @@ let weapon = {
|
||||
},
|
||||
};
|
||||
|
||||
let specialSet = {
|
||||
export {
|
||||
armor,
|
||||
back,
|
||||
body,
|
||||
@@ -5377,6 +5377,4 @@ let specialSet = {
|
||||
headAccessory,
|
||||
shield,
|
||||
weapon,
|
||||
};
|
||||
|
||||
module.exports = specialSet;
|
||||
};
|
||||
@@ -79,7 +79,7 @@ let weaponSpecial3 = {
|
||||
canOwn: isBackerOfLevel(300, 'weapon_special_3'),
|
||||
};
|
||||
|
||||
let backerSet = {
|
||||
export {
|
||||
armorSpecial0,
|
||||
armorSpecial2,
|
||||
headSpecial0,
|
||||
@@ -88,6 +88,4 @@ let backerSet = {
|
||||
weaponSpecial0,
|
||||
weaponSpecial2,
|
||||
weaponSpecial3,
|
||||
};
|
||||
|
||||
module.exports = backerSet;
|
||||
};
|
||||
@@ -68,12 +68,10 @@ let weaponSpecialCritical = {
|
||||
},
|
||||
};
|
||||
|
||||
let contributorSet = {
|
||||
export {
|
||||
armorSpecial1,
|
||||
headSpecial1,
|
||||
shieldSpecial1,
|
||||
weaponSpecial1,
|
||||
weaponSpecialCritical,
|
||||
};
|
||||
|
||||
module.exports = contributorSet;
|
||||
};
|
||||
@@ -60,13 +60,11 @@ let weaponSpecialTakeThis = {
|
||||
str: 5,
|
||||
};
|
||||
|
||||
let takeThisSet = {
|
||||
export {
|
||||
armorSpecialTakeThis,
|
||||
backSpecialTakeThis,
|
||||
bodySpecialTakeThis,
|
||||
headSpecialTakeThis,
|
||||
shieldSpecialTakeThis,
|
||||
weaponSpecialTakeThis,
|
||||
};
|
||||
|
||||
module.exports = takeThisSet;
|
||||
};
|
||||
@@ -49,7 +49,7 @@ let eyewearSpecialWonderconBlack = {
|
||||
mystery: 'wondercon',
|
||||
};
|
||||
|
||||
let wonderconSet = {
|
||||
export {
|
||||
backSpecialWonderconRed,
|
||||
backSpecialWonderconBlack,
|
||||
bodySpecialWonderconRed,
|
||||
@@ -57,6 +57,4 @@ let wonderconSet = {
|
||||
bodySpecialWonderconBlack,
|
||||
eyewearSpecialWonderconRed,
|
||||
eyewearSpecialWonderconBlack,
|
||||
};
|
||||
|
||||
module.exports = wonderconSet;
|
||||
};
|
||||
@@ -145,11 +145,9 @@ let weapon = {
|
||||
},
|
||||
};
|
||||
|
||||
let warriorSet = {
|
||||
export {
|
||||
armor,
|
||||
head,
|
||||
shield,
|
||||
weapon,
|
||||
};
|
||||
|
||||
module.exports = warriorSet;
|
||||
};
|
||||
@@ -131,11 +131,9 @@ let weapon = {
|
||||
},
|
||||
};
|
||||
|
||||
let wizardSet = {
|
||||
export {
|
||||
armor,
|
||||
head,
|
||||
shield,
|
||||
weapon,
|
||||
};
|
||||
|
||||
module.exports = wizardSet;
|
||||
};
|
||||
@@ -26,4 +26,4 @@ let shield = {
|
||||
armoire: armoireShield,
|
||||
};
|
||||
|
||||
module.exports = shield;
|
||||
export default shield;
|
||||
|
||||
@@ -64,4 +64,4 @@ for (let key in weapon) {
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = weapon;
|
||||
export default weapon;
|
||||
|
||||
@@ -281,7 +281,7 @@ each(wacky, (pot, key) => {
|
||||
|
||||
let all = assign({}, drops, premium, wacky);
|
||||
|
||||
module.exports = {
|
||||
export {
|
||||
drops,
|
||||
premium,
|
||||
wacky,
|
||||
|
||||
@@ -12,13 +12,13 @@ import {
|
||||
ANIMAL_COLOR_ACHIEVEMENTS,
|
||||
} from './constants';
|
||||
|
||||
let api = module.exports;
|
||||
const api = {};
|
||||
|
||||
import achievements from './achievements';
|
||||
|
||||
import eggs from './eggs';
|
||||
import hatchingPotions from './hatching-potions';
|
||||
import stable from './stable';
|
||||
import * as eggs from './eggs';
|
||||
import * as hatchingPotions from './hatching-potions';
|
||||
import * as stable from './stable';
|
||||
import gear from './gear';
|
||||
import {
|
||||
quests,
|
||||
@@ -912,3 +912,5 @@ api.userDefaultsMobile = {
|
||||
api.faq = faq;
|
||||
|
||||
api.loginIncentives = loginIncentives(api);
|
||||
|
||||
export default api;
|
||||
|
||||
@@ -3,7 +3,7 @@ import { MAX_INCENTIVES } from '../constants';
|
||||
|
||||
// NOTE do not import this file alone but only access it through common.content
|
||||
// so that it's already compiled
|
||||
module.exports = function getLoginIncentives (api) {
|
||||
export default function getLoginIncentives (api) {
|
||||
let loginIncentives = {
|
||||
1: {
|
||||
rewardKey: ['armor_special_bardRobes'],
|
||||
@@ -665,4 +665,4 @@ module.exports = function getLoginIncentives (api) {
|
||||
});
|
||||
|
||||
return loginIncentives;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -303,4 +303,4 @@ each(mysterySets, (value, key) => {
|
||||
value.class = `shop_set_mystery_${key}`;
|
||||
});
|
||||
|
||||
module.exports = mysterySets;
|
||||
export default mysterySets;
|
||||
|
||||
@@ -3531,7 +3531,7 @@ let questsByLevel = sortBy(quests, (quest) => {
|
||||
return quest.lvl || 0;
|
||||
});
|
||||
|
||||
module.exports = {
|
||||
export {
|
||||
quests,
|
||||
questsByLevel,
|
||||
userCanOwnQuestCategories,
|
||||
|
||||
@@ -677,4 +677,4 @@ each(spells, (spellClass) => {
|
||||
});
|
||||
});
|
||||
|
||||
module.exports = spells;
|
||||
export default spells;
|
||||
|
||||
@@ -141,7 +141,7 @@ each(specialMounts, (translationString, key) => {
|
||||
};
|
||||
});
|
||||
|
||||
module.exports = {
|
||||
export {
|
||||
dropPets,
|
||||
premiumPets,
|
||||
questPets,
|
||||
|
||||
@@ -54,4 +54,4 @@ each(subscriptionBlocks, function createKeys (b, k) {
|
||||
return b.key = k;
|
||||
});
|
||||
|
||||
module.exports = subscriptionBlocks;
|
||||
export default subscriptionBlocks;
|
||||
|
||||
@@ -31,7 +31,7 @@ let timeTravelerStore = (user) => {
|
||||
}, {});
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
export default {
|
||||
timeTravelerStore,
|
||||
mystery,
|
||||
};
|
||||
@@ -1,6 +1,6 @@
|
||||
import i18n from '../i18n';
|
||||
|
||||
module.exports = function translator (string, vars = { a: 'a' }) {
|
||||
export default function translator (string, vars = { a: 'a' }) {
|
||||
function func (lang) {
|
||||
return i18n.t(string, vars, lang);
|
||||
}
|
||||
@@ -8,4 +8,4 @@ module.exports = function translator (string, vars = { a: 'a' }) {
|
||||
func.i18nLangFunc = true; // Trick to recognize this type of function
|
||||
|
||||
return func;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import content from './content/index';
|
||||
|
||||
const DROP_ANIMALS = keys(content.pets);
|
||||
|
||||
function beastMasterProgress (pets = {}) {
|
||||
export function beastMasterProgress (pets = {}) {
|
||||
let count = 0;
|
||||
|
||||
each(DROP_ANIMALS, (animal) => {
|
||||
@@ -17,7 +17,7 @@ function beastMasterProgress (pets = {}) {
|
||||
return count;
|
||||
}
|
||||
|
||||
function beastCount (pets = {}) {
|
||||
export function beastCount (pets = {}) {
|
||||
let count = 0;
|
||||
|
||||
each(DROP_ANIMALS, (animal) => {
|
||||
@@ -27,7 +27,7 @@ function beastCount (pets = {}) {
|
||||
return count;
|
||||
}
|
||||
|
||||
function dropPetsCurrentlyOwned (pets = {}) {
|
||||
export function dropPetsCurrentlyOwned (pets = {}) {
|
||||
let count = 0;
|
||||
|
||||
each(DROP_ANIMALS, (animal) => {
|
||||
@@ -38,7 +38,7 @@ function dropPetsCurrentlyOwned (pets = {}) {
|
||||
return count;
|
||||
}
|
||||
|
||||
function mountMasterProgress (mounts = {}) {
|
||||
export function mountMasterProgress (mounts = {}) {
|
||||
let count = 0;
|
||||
|
||||
each(DROP_ANIMALS, (animal) => {
|
||||
@@ -49,7 +49,7 @@ function mountMasterProgress (mounts = {}) {
|
||||
return count;
|
||||
}
|
||||
|
||||
function remainingGearInSet (userGear = {}, set) {
|
||||
export function remainingGearInSet (userGear = {}, set) {
|
||||
let gear = filter(content.gear.flat, (item) => {
|
||||
let setMatches = item.klass === set;
|
||||
let hasItem = userGear[item.key];
|
||||
@@ -62,7 +62,7 @@ function remainingGearInSet (userGear = {}, set) {
|
||||
return count;
|
||||
}
|
||||
|
||||
function questsOfCategory (userQuests = {}, category) {
|
||||
export function questsOfCategory (userQuests = {}, category) {
|
||||
let quests = filter(content.quests, (quest) => {
|
||||
let categoryMatches = quest.category === category;
|
||||
let hasQuest = userQuests[quest.key];
|
||||
@@ -73,13 +73,4 @@ function questsOfCategory (userQuests = {}, category) {
|
||||
let count = size(quests);
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
beastMasterProgress,
|
||||
beastCount,
|
||||
dropPetsCurrentlyOwned,
|
||||
mountMasterProgress,
|
||||
remainingGearInSet,
|
||||
questsOfCategory,
|
||||
};
|
||||
}
|
||||
@@ -75,8 +75,8 @@ function getStatToAllocate (user) {
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = function autoAllocate (user) {
|
||||
export default function autoAllocate (user) {
|
||||
let statToIncrease = getStatToAllocate(user);
|
||||
|
||||
return user.stats[statToIncrease]++;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -10,4 +10,4 @@ function crit (user, stat = 'str', chance = 0.03) {
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = { crit };
|
||||
export default { crit };
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import content from '../content/index';
|
||||
import i18n from '../i18n';
|
||||
|
||||
module.exports = function handleTwoHanded (user, item, type = 'equipped', req = {}) {
|
||||
export default function handleTwoHanded (user, item, type = 'equipped', req = {}) {
|
||||
let currentShield = content.gear.flat[user.items.gear[type].shield];
|
||||
let currentWeapon = content.gear.flat[user.items.gear[type].weapon];
|
||||
|
||||
@@ -20,4 +20,4 @@ module.exports = function handleTwoHanded (user, item, type = 'equipped', req =
|
||||
}
|
||||
|
||||
return message;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import autoAllocate from './autoAllocate';
|
||||
import updateStats from './updateStats';
|
||||
import ultimateGear from './ultimateGear';
|
||||
|
||||
module.exports = {
|
||||
export default {
|
||||
handleTwoHanded,
|
||||
predictableRandom,
|
||||
crit,
|
||||
|
||||
@@ -5,7 +5,7 @@ import isNumber from 'lodash/isNumber';
|
||||
// Because the same op needs to be performed on the client and the server (critical hits, item drops, etc),
|
||||
// we need things to be "random", but technically predictable so that they don't go out-of-sync
|
||||
|
||||
module.exports = function predictableRandom (user, seed) {
|
||||
export default function predictableRandom (user, seed) {
|
||||
if (!seed || seed === Math.PI) {
|
||||
let stats = user.stats.toObject ? user.stats.toObject() : user.stats;
|
||||
// These items are not part of the stat object but exists on the server (see controllers/user#getUser)
|
||||
@@ -23,4 +23,4 @@ module.exports = function predictableRandom (user, seed) {
|
||||
|
||||
let x = Math.sin(seed++) * 10000;
|
||||
return x - Math.floor(x);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ function trueRandom () {
|
||||
return Math.random();
|
||||
}
|
||||
|
||||
module.exports = function randomDrop (user, options, req = {}, analytics) {
|
||||
export default function randomDrop (user, options, req = {}, analytics) {
|
||||
let acceptableDrops;
|
||||
let drop;
|
||||
let dropMultiplier;
|
||||
@@ -133,4 +133,4 @@ module.exports = function randomDrop (user, options, req = {}, analytics) {
|
||||
user.items.lastDrop.date = Number(new Date());
|
||||
user.items.lastDrop.count++;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import each from 'lodash/each';
|
||||
import content from '../content/index';
|
||||
|
||||
module.exports = function resetGear (user) {
|
||||
export default function resetGear (user) {
|
||||
let gear = user.items.gear;
|
||||
|
||||
each(['equipped', 'costume'], function resetUserGear (type) {
|
||||
@@ -24,4 +24,4 @@ module.exports = function resetGear (user) {
|
||||
if (user.markModified) user.markModified('items.gear.owned');
|
||||
|
||||
user.preferences.costume = false;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ import lodashFind from 'lodash/find';
|
||||
import reduce from 'lodash/reduce';
|
||||
import includes from 'lodash/includes';
|
||||
|
||||
module.exports = function ultimateGear (user) {
|
||||
export default function ultimateGear (user) {
|
||||
let owned = user.items.gear.owned.toObject ? user.items.gear.owned.toObject() : user.items.gear.owned;
|
||||
|
||||
content.classes.forEach((klass) => {
|
||||
@@ -35,4 +35,4 @@ module.exports = function ultimateGear (user) {
|
||||
}
|
||||
|
||||
return;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
import { toNextLevel } from '../statHelpers';
|
||||
import autoAllocate from './autoAllocate';
|
||||
|
||||
module.exports = function updateStats (user, stats, req = {}, analytics) {
|
||||
export default function updateStats (user, stats, req = {}, analytics) {
|
||||
let allocatedStatPoints;
|
||||
let totalStatPoints;
|
||||
let experienceToNextLevel;
|
||||
@@ -111,4 +111,4 @@ module.exports = function updateStats (user, stats, req = {}, analytics) {
|
||||
if (user.addNotification) user.addNotification('REBIRTH_ENABLED');
|
||||
user.flags.rebirthEnabled = true;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import isString from 'lodash/isString';
|
||||
import clone from 'lodash/clone';
|
||||
import template from 'lodash/template';
|
||||
|
||||
let i18n = {
|
||||
const i18n = {
|
||||
strings: null,
|
||||
translations: {},
|
||||
t, // eslint-disable-line no-use-before-define
|
||||
@@ -62,4 +62,4 @@ function t (stringName) {
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = i18n;
|
||||
export default i18n;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// When using a common module from the website or the server NEVER import the module directly
|
||||
// but access it through `api` (the main common) module, otherwise you would require the non transpiled version of the file in production.
|
||||
let api = module.exports = {};
|
||||
const api = {};
|
||||
|
||||
import content from './content/index';
|
||||
api.content = content;
|
||||
@@ -101,7 +101,7 @@ api.appliedTags = appliedTags;
|
||||
import pickDeep from './libs/pickDeep';
|
||||
api.pickDeep = pickDeep;
|
||||
|
||||
import count from './count';
|
||||
import * as count from './count';
|
||||
api.count = count;
|
||||
|
||||
import statsComputed from './libs/statsComputed';
|
||||
@@ -164,7 +164,7 @@ import blockUser from './ops/blockUser';
|
||||
import reroll from './ops/reroll';
|
||||
import reset from './ops/reset';
|
||||
import markPmsRead from './ops/markPMSRead';
|
||||
import pinnedGearUtils from './ops/pinnedGearUtils';
|
||||
import * as pinnedGearUtils from './ops/pinnedGearUtils';
|
||||
|
||||
api.ops = {
|
||||
scoreTask,
|
||||
@@ -194,3 +194,5 @@ api.ops = {
|
||||
markPmsRead,
|
||||
pinnedGearUtils,
|
||||
};
|
||||
|
||||
export default api;
|
||||
|
||||
@@ -328,4 +328,4 @@ achievs.getAchievementsForProfile = function getAchievementsForProfile (user, la
|
||||
|
||||
achievs.getContribText = contribText;
|
||||
|
||||
module.exports = achievs;
|
||||
export default achievs;
|
||||
|
||||
@@ -4,11 +4,11 @@ Are there tags applied?
|
||||
|
||||
// TODO move to client
|
||||
|
||||
module.exports = function appliedTags (userTags, taskTags = []) {
|
||||
export default function appliedTags (userTags, taskTags = []) {
|
||||
let arr = userTags.filter(tag => {
|
||||
return taskTags.indexOf(tag.id) !== -1;
|
||||
}).map(tag => {
|
||||
return tag.name;
|
||||
});
|
||||
return arr.join(', ');
|
||||
};
|
||||
}
|
||||
|
||||
@@ -2,4 +2,4 @@ import get from 'lodash/get';
|
||||
|
||||
// TODO remove completely, only used in client
|
||||
|
||||
module.exports = get;
|
||||
export default get;
|
||||
|
||||
@@ -2,4 +2,4 @@ import set from 'lodash/set';
|
||||
|
||||
// TODO remove completely, only used in client
|
||||
|
||||
module.exports = set;
|
||||
export default set;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Babel 6 doesn't support extending native class (Error, Array, ...)
|
||||
// This function makes it possible to extend native classes with the same results as Babel 5
|
||||
module.exports = function extendableBuiltin (klass) {
|
||||
export default function extendableBuiltin (klass) {
|
||||
function ExtendableBuiltin () {
|
||||
klass.apply(this, arguments);
|
||||
}
|
||||
@@ -8,4 +8,4 @@ module.exports = function extendableBuiltin (klass) {
|
||||
Object.setPrototypeOf(ExtendableBuiltin, klass);
|
||||
|
||||
return ExtendableBuiltin;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import content from '../content/index';
|
||||
import get from 'lodash/get';
|
||||
|
||||
module.exports = function getItemByPathAndType (type, path) {
|
||||
export default function getItemByPathAndType (type, path) {
|
||||
let item = get(content, path);
|
||||
|
||||
if (type === 'timeTravelersStable') {
|
||||
@@ -14,4 +14,4 @@ module.exports = function getItemByPathAndType (type, path) {
|
||||
}
|
||||
|
||||
return item;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import i18n from '../i18n';
|
||||
import content from '../content/index';
|
||||
import { BadRequest } from './errors';
|
||||
import count from '../count';
|
||||
import * as count from '../count';
|
||||
|
||||
import isPinned from './isPinned';
|
||||
import isFreeRebirth from './isFreeRebirth';
|
||||
@@ -46,7 +46,7 @@ function getDefaultGearProps (item, language) {
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = function getItemInfo (user, type, item, officialPinnedItems, language = 'en') {
|
||||
export default function getItemInfo (user, type, item, officialPinnedItems, language = 'en') {
|
||||
if (officialPinnedItems === undefined) {
|
||||
officialPinnedItems = getOfficialPinnedItems(user);
|
||||
}
|
||||
@@ -124,7 +124,7 @@ module.exports = function getItemInfo (user, type, item, officialPinnedItems, la
|
||||
};
|
||||
break;
|
||||
case 'quests': // eslint-disable-line no-case-declarations
|
||||
const locked = lockQuest(item, user);
|
||||
const locked = lockQuest(item, user); // eslint-disable-line no-case-declarations
|
||||
|
||||
itemInfo = {
|
||||
key: item.key,
|
||||
@@ -351,4 +351,4 @@ module.exports = function getItemInfo (user, type, item, officialPinnedItems, la
|
||||
}
|
||||
|
||||
return itemInfo;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ const officialPinnedItems = content.officialPinnedItems;
|
||||
|
||||
let flatGearArray = toArray(content.gear.flat);
|
||||
|
||||
module.exports = function getOfficialPinnedItems (user) {
|
||||
export default function getOfficialPinnedItems (user) {
|
||||
let officialItemsArray = [...officialPinnedItems];
|
||||
|
||||
if (SeasonalShopConfig.pinnedSets && Boolean(user) && user.stats.class) {
|
||||
@@ -25,4 +25,4 @@ module.exports = function getOfficialPinnedItems (user) {
|
||||
}
|
||||
|
||||
return officialItemsArray;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
// TODO move to client
|
||||
|
||||
module.exports = function gold (num) {
|
||||
export default function gold (num) {
|
||||
if (num) {
|
||||
return Math.floor(num);
|
||||
} else {
|
||||
return '0';
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// Check if user has Class system enabled
|
||||
module.exports = function hasClass (member) {
|
||||
export default function hasClass (member) {
|
||||
return (
|
||||
member.stats.lvl >= 10 &&
|
||||
!member.preferences.disableClasses &&
|
||||
member.flags.classSelected
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ function sortInAppRewards (user, items) {
|
||||
return orderedItems;
|
||||
}
|
||||
|
||||
module.exports = function getPinnedItems (user) {
|
||||
export default function getPinnedItems (user) {
|
||||
checkPinnedAreasForNullEntries(user);
|
||||
|
||||
let officialPinnedItems = getOfficialPinnedItems(user);
|
||||
@@ -55,4 +55,4 @@ module.exports = function getPinnedItems (user) {
|
||||
|
||||
let orderedItems = sortInAppRewards(user, items);
|
||||
return orderedItems;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import moment from 'moment';
|
||||
import { MAX_LEVEL } from '../constants';
|
||||
|
||||
module.exports = function isFreeRebirth (user) {
|
||||
export default function isFreeRebirth (user) {
|
||||
let daysFromLastFreeRebirth = user.flags.lastFreeRebirth;
|
||||
|
||||
if (daysFromLastFreeRebirth) {
|
||||
@@ -11,4 +11,4 @@ module.exports = function isFreeRebirth (user) {
|
||||
}
|
||||
|
||||
return user.stats.lvl >= MAX_LEVEL && daysFromLastFreeRebirth > 45;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
|
||||
module.exports = function isPinned (user, item, checkOfficialPinnedItems /* getOfficialPinnedItems */) {
|
||||
export default function isPinned (user, item, checkOfficialPinnedItems /* getOfficialPinnedItems */) {
|
||||
if (user === null)
|
||||
return false;
|
||||
|
||||
@@ -11,4 +10,4 @@ module.exports = function isPinned (user, item, checkOfficialPinnedItems /* getO
|
||||
return true;
|
||||
|
||||
return isItemPinned;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -7,8 +7,8 @@ are any tags active?
|
||||
|
||||
// TODO move to client
|
||||
|
||||
module.exports = function noTags (tags) {
|
||||
export default function noTags (tags) {
|
||||
return isEmpty(tags) || isEmpty(filter(tags, (t) => {
|
||||
return t;
|
||||
}));
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// TODO move to client
|
||||
|
||||
module.exports = function percent (x, y, dir) {
|
||||
export default function percent (x, y, dir) {
|
||||
let roundFn;
|
||||
switch (dir) {
|
||||
case 'up':
|
||||
@@ -16,4 +16,4 @@ module.exports = function percent (x, y, dir) {
|
||||
x = 1;
|
||||
}
|
||||
return Math.max(0, roundFn(x / y * 100));
|
||||
};
|
||||
}
|
||||
|
||||
@@ -5,11 +5,11 @@ import each from 'lodash/each';
|
||||
import set from 'lodash/set';
|
||||
import get from 'lodash/get';
|
||||
|
||||
module.exports = function pickDeep (obj, properties) {
|
||||
export default function pickDeep (obj, properties) {
|
||||
if (!Array.isArray(properties)) throw new Error('"properties" must be an array');
|
||||
|
||||
let result = {};
|
||||
each(properties, (prop) => set(result, prop, get(obj, prop)));
|
||||
|
||||
return result;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
module.exports = {
|
||||
export default {
|
||||
convRate: 20,
|
||||
convCap: 25,
|
||||
};
|
||||
|
||||
@@ -3,10 +3,10 @@ import filter from 'lodash/filter';
|
||||
|
||||
// TODO used only in v2
|
||||
|
||||
module.exports = function preenTodos (tasks) {
|
||||
export default function preenTodos (tasks) {
|
||||
return filter(tasks, (t) => {
|
||||
return !t.completed || t.challenge && t.challenge.id || moment(t.dateCompleted).isAfter(moment().subtract({
|
||||
days: 3,
|
||||
}));
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import values from 'lodash/values';
|
||||
import keys from 'lodash/keys';
|
||||
|
||||
function trueRandom () {
|
||||
export function trueRandom () {
|
||||
return Math.random();
|
||||
}
|
||||
|
||||
// Get a random property from an object
|
||||
// returns random property (the value)
|
||||
module.exports = function randomVal (obj, options = {}) {
|
||||
export default function randomVal (obj, options = {}) {
|
||||
let array = options.key ? keys(obj) : values(obj);
|
||||
let random = options.predictableRandom || trueRandom();
|
||||
|
||||
@@ -16,6 +16,4 @@ module.exports = function randomVal (obj, options = {}) {
|
||||
let randomIndex = Math.floor(random * array.length);
|
||||
|
||||
return array[randomIndex];
|
||||
};
|
||||
|
||||
module.exports.trueRandom = trueRandom;
|
||||
}
|
||||
@@ -9,7 +9,7 @@ import uuid from './uuid';
|
||||
no problem. To maintain sorting, we use these helper functions:
|
||||
*/
|
||||
|
||||
module.exports = function refPush (reflist, item) {
|
||||
export default function refPush (reflist, item) {
|
||||
item.sort = isEmpty(reflist) ? 0 : maxBy(values(reflist), 'sort').sort + 1;
|
||||
|
||||
if (!(item.id && !reflist[item.id])) {
|
||||
@@ -19,4 +19,4 @@ module.exports = function refPush (reflist, item) {
|
||||
reflist[item.id] = item;
|
||||
|
||||
return reflist[item.id];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { SEASONAL_SETS } from '../content/constants';
|
||||
|
||||
module.exports = {
|
||||
export default {
|
||||
opened: true,
|
||||
|
||||
currentSeason: 'Fall',
|
||||
|
||||
@@ -539,4 +539,4 @@ shops.getBackgroundShopSets = function getBackgroundShopSets (language) {
|
||||
return sets;
|
||||
};
|
||||
|
||||
module.exports = shops;
|
||||
export default shops;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user