mirror of
https://github.com/romancm/gamebrary
synced 2024-11-24 04:03:06 +00:00
replace entire lodash with subpackages
This commit is contained in:
parent
3b23a147bb
commit
51c446bea8
4 changed files with 11 additions and 14 deletions
|
@ -23,7 +23,9 @@
|
|||
"firebase": "^5.5.5",
|
||||
"firebase-admin": "^6.0.0",
|
||||
"firebase-functions": "^2.0.5",
|
||||
"lodash": "^4.17.13",
|
||||
"lodash.chunk": "^4.2.0",
|
||||
"lodash.orderby": "^4.6.0",
|
||||
"lodash.sortby": "^4.7.0",
|
||||
"moment": "^2.22.1",
|
||||
"node-sass": "^4.8.3",
|
||||
"raven-js": "^3.27.0",
|
||||
|
|
|
@ -56,7 +56,7 @@ import GameCardGrid from '@/components/GameCards/GameCardGrid';
|
|||
import GameCardCompact from '@/components/GameCards/GameCardCompact';
|
||||
import GameCardText from '@/components/GameCards/GameCardText';
|
||||
import AddGameModal from '@/components/Lists/AddGameModal';
|
||||
import { orderBy } from 'lodash';
|
||||
import orderby from 'lodash.orderby';
|
||||
import { mapState } from 'vuex';
|
||||
|
||||
export default {
|
||||
|
@ -126,7 +126,7 @@ export default {
|
|||
case 'sortByCustom':
|
||||
return gameList;
|
||||
case 'sortByProgress':
|
||||
return orderBy(gameList, [(game) => {
|
||||
return orderby(gameList, [(game) => {
|
||||
const progress = this.games[game]
|
||||
&& this.progresses[this.platform.code][this.games[game].id]
|
||||
? Number(this.progresses[this.platform.code][this.games[game].id])
|
||||
|
@ -135,7 +135,7 @@ export default {
|
|||
return progress;
|
||||
}], ['desc']);
|
||||
case 'sortByRating':
|
||||
return orderBy(gameList, [(game) => {
|
||||
return orderby(gameList, [(game) => {
|
||||
const rating = this.games[game] && this.games[game].rating
|
||||
? this.games[game].rating
|
||||
: 0;
|
||||
|
@ -143,7 +143,7 @@ export default {
|
|||
return rating;
|
||||
}], ['desc']);
|
||||
case 'sortByName':
|
||||
return orderBy(gameList, [(game) => {
|
||||
return orderby(gameList, [(game) => {
|
||||
const name = this.games[game] && this.games[game].name
|
||||
? this.games[game].name.toUpperCase()
|
||||
: '';
|
||||
|
@ -151,7 +151,7 @@ export default {
|
|||
return name;
|
||||
}]);
|
||||
case 'sortByReleaseDate':
|
||||
return orderBy(gameList, [(game) => {
|
||||
return orderby(gameList, [(game) => {
|
||||
const releaseDate = this.games[game] && this.games[game].release_dates
|
||||
? this.games[game].release_dates
|
||||
.find(({ platform }) => this.platform.id === platform)
|
||||
|
@ -291,9 +291,4 @@ export default {
|
|||
.list-settings {
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
.fa-grip-vertical {
|
||||
opacity: 0.5;
|
||||
margin-right: .5rem;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -24,7 +24,7 @@ import GameTagsModal from '@/components/Board/GameTagsModal';
|
|||
import AddList from '@/components/Board/AddList';
|
||||
import GameModal from '@/components/Board/GameModal';
|
||||
import List from '@/components/Lists/List';
|
||||
import { chunk } from 'lodash';
|
||||
import chunk from 'lodash.chunk';
|
||||
import { mapState } from 'vuex';
|
||||
import draggable from 'vuedraggable';
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ import platforms from '@/platforms';
|
|||
import PlatformsFooter from '@/components/Platforms/PlatformsFooter';
|
||||
import PlatformsHeader from '@/components/Platforms/PlatformsHeader';
|
||||
import PlatformsList from '@/components/Platforms/PlatformsList';
|
||||
import { sortBy } from 'lodash';
|
||||
import sortby from 'lodash.sortby';
|
||||
import { mapState } from 'vuex';
|
||||
|
||||
export default {
|
||||
|
@ -66,7 +66,7 @@ export default {
|
|||
|
||||
sortedPlatforms() {
|
||||
const sortedPlatforms = this.platformsSortField
|
||||
? sortBy(this.filteredPlatforms, this.platformsSortField)
|
||||
? sortby(this.filteredPlatforms, this.platformsSortField)
|
||||
: this.filteredPlatforms;
|
||||
|
||||
return this.platformsSortField === 'releaseYear'
|
||||
|
|
Loading…
Reference in a new issue