From ed3d15501a54b3a1129f4083019fb0f7ad7e49e2 Mon Sep 17 00:00:00 2001 From: Fabio Spampinato Date: Tue, 4 Jun 2019 03:52:01 +0200 Subject: [PATCH] =?UTF-8?q?Aligned=20=E2=80=9Clodash=E2=80=9D=20version=20?= =?UTF-8?q?with=20other=20dependencies,=20so=20that=20it=20gets=20deduplic?= =?UTF-8?q?ated?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 5 +---- src/diagrams/git/gitGraphAst.js | 10 ++++------ src/diagrams/git/gitGraphRenderer.js | 4 ++-- yarn.lock | 15 --------------- 4 files changed, 7 insertions(+), 27 deletions(-) diff --git a/package.json b/package.json index e73b01299e..6e26956a49 100644 --- a/package.json +++ b/package.json @@ -41,10 +41,7 @@ "dagre-layout": "^0.8.8", "graphlibrary": "^2.2.0", "he": "^1.2.0", - "lodash.assign": "^4.2.0", - "lodash.maxby": "^4.6.0", - "lodash.orderby": "^4.6.0", - "lodash.uniqby": "^4.7.0", + "lodash": "^4.17.5", "moment-mini": "^2.22.1", "scope-css": "^1.2.1" }, diff --git a/src/diagrams/git/gitGraphAst.js b/src/diagrams/git/gitGraphAst.js index f71a15a8c5..f7338c5ed7 100644 --- a/src/diagrams/git/gitGraphAst.js +++ b/src/diagrams/git/gitGraphAst.js @@ -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 } diff --git a/src/diagrams/git/gitGraphRenderer.js b/src/diagrams/git/gitGraphRenderer.js index 79aae45fe5..00f56ed1a2 100644 --- a/src/diagrams/git/gitGraphRenderer.js +++ b/src/diagrams/git/gitGraphRenderer.js @@ -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() diff --git a/yarn.lock b/yarn.lock index e0acdf892a..05126cf55d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5163,21 +5163,11 @@ lodash.keys@^3.0.0: lodash.isarguments "^3.0.0" lodash.isarray "^3.0.0" -lodash.maxby@^4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/lodash.maxby/-/lodash.maxby-4.6.0.tgz#082240068f3c7a227aa00a8380e4f38cf0786e3d" - integrity sha1-CCJABo88eiJ6oAqDgOTzjPB4bj0= - lodash.mergewith@^4.6.0: version "4.6.1" resolved "https://registry.yarnpkg.com/lodash.mergewith/-/lodash.mergewith-4.6.1.tgz#639057e726c3afbdb3e7d42741caa8d6e4335927" integrity sha512-eWw5r+PYICtEBgrBE5hhlT6aAa75f411bgDz/ZL2KZqYV03USvucsxcHUIlGTDTECs1eunpI7HOV7U+WLDvNdQ== -lodash.orderby@^4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/lodash.orderby/-/lodash.orderby-4.6.0.tgz#e697f04ce5d78522f54d9338b32b81a3393e4eb3" - integrity sha1-5pfwTOXXhSL1TZM4syuBozk+TrM= - lodash.restparam@^3.0.0: version "3.6.1" resolved "https://registry.yarnpkg.com/lodash.restparam/-/lodash.restparam-3.6.1.tgz#936a4e309ef330a7645ed4145986c85ae5b20805" @@ -5213,11 +5203,6 @@ lodash.templatesettings@^3.0.0: lodash._reinterpolate "^3.0.0" lodash.escape "^3.0.0" -lodash.uniqby@^4.7.0: - version "4.7.0" - resolved "https://registry.yarnpkg.com/lodash.uniqby/-/lodash.uniqby-4.7.0.tgz#d99c07a669e9e6d24e1362dfe266c67616af1302" - integrity sha1-2ZwHpmnp5tJOE2Lf4mbGdhavEwI= - lodash@^4.0.0, lodash@^4.13.1, lodash@^4.17.10, lodash@^4.17.11, lodash@^4.3.0, lodash@~4.17.10: version "4.17.11" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d"