Aligned “lodash” version with other dependencies, so that it gets deduplicated

This commit is contained in:
Fabio Spampinato
2019-06-04 03:52:01 +02:00
parent fef85cf259
commit ed3d15501a
4 changed files with 7 additions and 27 deletions

View File

@@ -1,6 +1,4 @@
import maxBy from 'lodash.maxby'
import orderBy from 'lodash.orderby'
import uniqBy from 'lodash.uniqby'
import _ from 'lodash'
import { logger } from '../../logger'
@@ -147,7 +145,7 @@ function upsert (arr, key, newval) {
}
function prettyPrintCommitHistory (commitArr) {
const commit = maxBy(commitArr, 'seq')
const commit = _.maxBy(commitArr, 'seq')
let line = ''
commitArr.forEach(function (c) {
if (c === commit) {
@@ -171,7 +169,7 @@ function prettyPrintCommitHistory (commitArr) {
const nextCommit = commits[commit.parent]
upsert(commitArr, commit, nextCommit)
}
commitArr = uniqBy(commitArr, 'id')
commitArr = _.uniqBy(commitArr, 'id')
prettyPrintCommitHistory(commitArr)
}
@@ -204,7 +202,7 @@ export const getCommitsArray = function () {
return commits[key]
})
commitArr.forEach(function (o) { logger.debug(o.id) })
return orderBy(commitArr, ['seq'], ['desc'])
return _.orderBy(commitArr, ['seq'], ['desc'])
}
export const getCurrentBranch = function () { return curBranch }
export const getDirection = function () { return direction }

View File

@@ -1,5 +1,5 @@
import * as d3 from 'd3'
import assign from 'lodash.assign'
import _ from 'lodash'
import db from './gitGraphAst'
import gitGraphParser from './parser/gitGraph'
@@ -252,7 +252,7 @@ export const draw = function (txt, id, ver) {
// Parse the graph definition
parser.parse(txt + '\n')
config = assign(config, apiConfig, db.getOptions())
config = _.assign(config, apiConfig, db.getOptions())
logger.debug('effective options', config)
const direction = db.getDirection()
allCommitsDict = db.getCommits()