mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-28 07:03:17 +08:00
fix more eslint issues
This commit is contained in:
parent
6c28c55ea7
commit
719ee2e001
@ -136,7 +136,7 @@ function upsert(arr, key, newval) {
|
|||||||
function prettyPrintCommitHistory(commitArr) {
|
function prettyPrintCommitHistory(commitArr) {
|
||||||
var commit = _.maxBy(commitArr, 'seq');
|
var commit = _.maxBy(commitArr, 'seq');
|
||||||
var line = '';
|
var line = '';
|
||||||
_.each(commitArr, function(c, idx) {
|
_.each(commitArr, function(c) {
|
||||||
if (c == commit) {
|
if (c == commit) {
|
||||||
line += '\t*'
|
line += '\t*'
|
||||||
} else {
|
} else {
|
||||||
@ -147,7 +147,7 @@ function prettyPrintCommitHistory(commitArr) {
|
|||||||
_.each(branches, function(v,k){
|
_.each(branches, function(v,k){
|
||||||
if (v == commit.id) label.push(k);
|
if (v == commit.id) label.push(k);
|
||||||
});
|
});
|
||||||
console.log.apply(console, label);
|
log.debug(label);
|
||||||
if (Array.isArray(commit.parent)) {
|
if (Array.isArray(commit.parent)) {
|
||||||
//console.log("here", commit.parent);
|
//console.log("here", commit.parent);
|
||||||
var newCommit = commits[commit.parent[0]];
|
var newCommit = commits[commit.parent[0]];
|
||||||
@ -157,8 +157,8 @@ function prettyPrintCommitHistory(commitArr) {
|
|||||||
} else if(commit.parent == null){
|
} else if(commit.parent == null){
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
var newCommit = commits[commit.parent];
|
var nextCommit = commits[commit.parent];
|
||||||
upsert(commitArr, commit, newCommit);
|
upsert(commitArr, commit, nextCommit);
|
||||||
}
|
}
|
||||||
commitArr = _.uniqBy(commitArr, 'id');
|
commitArr = _.uniqBy(commitArr, 'id');
|
||||||
prettyPrintCommitHistory(commitArr);
|
prettyPrintCommitHistory(commitArr);
|
||||||
@ -188,7 +188,7 @@ exports.getCommitsArray = function() {
|
|||||||
var commitArr = Object.keys(commits).map(function (key) {
|
var commitArr = Object.keys(commits).map(function (key) {
|
||||||
return commits[key];
|
return commits[key];
|
||||||
});
|
});
|
||||||
_.each(commitArr, function(o) { console.log(o.id) });
|
_.each(commitArr, function(o) { log.debug(o.id) });
|
||||||
return _.orderBy(commitArr, ['seq'], ['desc']);
|
return _.orderBy(commitArr, ['seq'], ['desc']);
|
||||||
}
|
}
|
||||||
exports.getCurrentBranch = function() { return curBranch; }
|
exports.getCurrentBranch = function() { return curBranch; }
|
||||||
|
@ -47,7 +47,7 @@ describe('when parsing a gitGraph',function() {
|
|||||||
parser.parse(str);
|
parser.parse(str);
|
||||||
var commits = parser.yy.getCommits();
|
var commits = parser.yy.getCommits();
|
||||||
//console.log(commits);
|
//console.log(commits);
|
||||||
console.log('options object', parser.yy.getOptions());
|
//console.log('options object', parser.yy.getOptions());
|
||||||
expect(parser.yy.getOptions()['key']).toBe('value');
|
expect(parser.yy.getOptions()['key']).toBe('value');
|
||||||
expect(Object.keys(commits).length).toBe(1);
|
expect(Object.keys(commits).length).toBe(1);
|
||||||
expect(parser.yy.getCurrentBranch()).toBe('master');
|
expect(parser.yy.getCurrentBranch()).toBe('master');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user