Comparing version 2.1.1 to 2.2.0
## 2.2.0 | ||
- remove lodash | ||
## 2.1.1 | ||
@@ -3,0 +7,0 @@ |
@@ -6,3 +6,2 @@ var fs = require('fs'); | ||
var path = require('path'); | ||
var _ = require('lodash'); | ||
var helper = require('../helper.js'); | ||
@@ -37,3 +36,3 @@ var cliCommand = require('../cliCommand.js'); | ||
data.type = 'git'; | ||
data.url = _.get(config, 'remote "origin".url'); | ||
data.url = helper.get(config, 'remote "origin".url'); | ||
@@ -50,4 +49,4 @@ cb(null, data); | ||
data.revision = _.get(commit, 'hash'); | ||
data.comment = _.get(commit, 'message'); | ||
data.revision = helper.get(commit, 'hash'); | ||
data.comment = helper.get(commit, 'message'); | ||
cb(null, data); | ||
@@ -92,3 +91,3 @@ }); | ||
_.forEach(config, function (value, key) { | ||
Object.keys(config).map(function (key) { | ||
var regex = /remote "(.*)"/; | ||
@@ -127,3 +126,3 @@ var match = regex.exec(key); | ||
var currentCommitIndex = _.findIndex(commitHistory, {hash: data.revision}); | ||
var currentCommitIndex = commitHistory.findIndex(({ hash }) => hash === data.revision); | ||
@@ -130,0 +129,0 @@ if (currentCommitIndex === -1) { |
var path = require('path'); | ||
var whilst = require('async/whilst'); | ||
var _ = require('lodash') | ||
var helper = require('../helper.js'); | ||
@@ -116,3 +116,3 @@ var jsGitService = {}; | ||
var count = 1; | ||
var parentCommitHash = _.last(commit.parents); // last parent is the parent in the 'git log' meaning | ||
var parentCommitHash = helper.last(commit.parents); // last parent is the parent in the 'git log' meaning | ||
@@ -138,3 +138,3 @@ whilst( | ||
commitHistory.push(commit); | ||
parentCommitHash = _.last(commit.parents); | ||
parentCommitHash = helper.last(commit.parents); | ||
callback(null); | ||
@@ -141,0 +141,0 @@ }); |
@@ -5,4 +5,25 @@ function trimNewLine(input) { | ||
function get(object, path) { | ||
const pathArray = path.split('.'); | ||
let result = object; | ||
while (pathArray.length) { | ||
const pathItem = pathArray.shift(); | ||
if (pathItem in result) { | ||
result = result[pathItem]; | ||
} else { | ||
return undefined; | ||
} | ||
} | ||
return result; | ||
} | ||
function last(array) { | ||
var length = array == null ? 0 : array.length; | ||
return length ? array[length - 1] : undefined; | ||
} | ||
module.exports = { | ||
trimNewLine: trimNewLine | ||
}; | ||
get: get, | ||
last: last, | ||
trimNewLine: trimNewLine, | ||
}; |
{ | ||
"name": "vizion", | ||
"version": "2.1.1", | ||
"version": "2.2.0", | ||
"engines": { | ||
@@ -36,4 +36,3 @@ "node": ">=4.0" | ||
"ini": "^1.3.5", | ||
"js-git": "^0.7.8", | ||
"lodash": "4.17.15" | ||
"js-git": "^0.7.8" | ||
}, | ||
@@ -40,0 +39,0 @@ "devDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
50725
4
1308
+ Addedlodash@4.17.21(transitive)
- Removedlodash@4.17.15
- Removedlodash@4.17.15(transitive)