changed-log
Advanced tools
Comparing version 0.4.2 to 0.5.0
{ | ||
"name": "changed-log", | ||
"version": "0.4.2", | ||
"version": "0.5.0", | ||
"description": "Returns all commit messages between 2 versions of an NPM module", | ||
@@ -5,0 +5,0 @@ "main": "src/changed-log.js", |
@@ -9,2 +9,3 @@ require('lazy-ass'); | ||
var gTags = Promise.promisify(reposApi.getTags); | ||
var debug = require('debug')('tags'); | ||
@@ -48,7 +49,26 @@ function nameAndSha(tags) { | ||
la(check.array(allTags), 'missing tags', allTags); | ||
var fromTag = _.find(allTags, 'name', question.from); | ||
la(fromTag, 'cannot find tag', question.from, 'all tags', allTags); | ||
var toTag = _.find(allTags, 'name', question.to); | ||
la(toTag, 'cannot to tag', question.to, 'all tags', allTags); | ||
var fromTagIndex = _.findIndex(allTags, 'name', question.from); | ||
la(fromTagIndex !== -1, 'cannot find tag', question.from, 'all tags', allTags); | ||
var toTagIndex = _.findIndex(allTags, 'name', question.to); | ||
la(toTagIndex !== -1, 'cannot to tag', question.to, 'all tags', allTags); | ||
debug('from tag %s index %d to tag %s index %d', | ||
question.from, fromTagIndex, | ||
question.to, toTagIndex); | ||
if (fromTagIndex < toTagIndex) { | ||
debug('flipping the tag order'); | ||
var tmp = fromTagIndex; | ||
fromTagIndex = toTagIndex; | ||
toTagIndex = tmp; | ||
tmp = question.from; | ||
question.from = question.to; | ||
question.to = tmp; | ||
} | ||
var fromTag = allTags[fromTagIndex]; | ||
var toTag = allTags[toTagIndex]; | ||
return { | ||
@@ -83,2 +103,16 @@ fromTag: fromTag, | ||
function nextUpdateReverseTagOrderExample() { | ||
var question = { | ||
user: 'bahmutov', | ||
repo: 'next-update', | ||
from: '0.8.2', | ||
to: '0.8.0' | ||
}; | ||
log('Getting commit SHA for the given tags'); | ||
log(question); | ||
getFromToTags(question) | ||
.then(log); | ||
} | ||
function chalkExample() { | ||
@@ -99,4 +133,5 @@ var question = { | ||
chalkExample(); | ||
// chalkExample(); | ||
nextUpdateReverseTagOrderExample(); | ||
}()); | ||
} |
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
421778
670