Skip to content

Commit 1d9755c

Browse files
committed
Refactoring -> remove all extra lines in 'var' declarations
1 parent 75c7f1e commit 1d9755c

4 files changed

Lines changed: 2 additions & 10 deletions

File tree

lib/cli.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ module.exports = require('coa').Cmd()
5555
var options = utils.defaults(config),
5656
loggerOptions = {
5757
charsAroundDiff: opts.charsAroundDiff
58-
};
58+
},
59+
htmlDiffer = new HtmlDiffer(options);
5960

60-
htmlDiffer = new HtmlDiffer(options),
6161
diffLogger.log(htmlDiffer.diffHtml(html1, html2), loggerOptions);
6262
});
6363
})

lib/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
var utils = require('./utils'),
2-
32
diff = require('diff'),
43
htmlParser = require('htmlparser2'),
54
AST2Html = require('htmlparser-to-html'),
@@ -206,7 +205,6 @@ function bemDiff(html1, html2) {
206205
loggerOptions = {
207206
showCharacters: 40
208207
},
209-
210208
htmlDiffer = new HtmlDiff(options);
211209

212210
logger.log(htmlDiffer.diff(html1, html2), loggerOptions);

test/diffHtml.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ describe('\'diffHtml\'', function () {
1414

1515
it('must set options', function () {
1616
var htmlDiffer = new HtmlDiffer({ ignoreHtmlAttrs: ['id', 'for'], ignoreWhitespace: true }),
17-
1817
files = readFiles('3.html', '_3.html'),
19-
2018
res = [ {
2119
value: '<html><head><title>Test</title></head><body><label for="">label for input</label><input id=""></body></html>',
2220
added: undefined,

test/getDiffText.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ describe('\'diffHtml\'', function () {
3838
added: undefined,
3939
removed: undefined
4040
} ],
41-
4241
out = '\n...\n' + 'texttexttexttexttext'.grey + '!'.inverse.green + 'Text'.grey + '!'.inverse.green + 'texttexttexttext'.grey;
4342

4443
diffLoger.getDiffText(inp, { charsAroundDiff: 20 }).must.be.eql(out);
@@ -67,7 +66,6 @@ describe('\'diffHtml\'', function () {
6766
added: false,
6867
removed: true
6968
} ],
70-
7169
out = '\n' + 'texttexttexttexttexttexttexttexttexttexttext'.inverse.green + 'ololoololoololoololoololoololoololoololoolol'.inverse.red;
7270

7371
diffLoger.getDiffText(inp, { charsAroundDiff: 20 }).must.be.eql(out);
@@ -88,7 +86,6 @@ describe('\'diffHtml\'', function () {
8886
added: undefined,
8987
removed: undefined
9088
} ],
91-
9289
out = '\n' + 'texttexttext'.grey + 'text'.inverse.red + 'texttexttexttext'.grey;
9390

9491
diffLoger.getDiffText(inp).must.be.eql(out);
@@ -125,7 +122,6 @@ describe('\'diffHtml\'', function () {
125122
added: undefined,
126123
removed: undefined
127124
} ],
128-
129125
out = '\n...\n' + 'texttexttexttexttext'.grey + 'text'.inverse.red + 'texttexttexttexttext'.grey + '\n...\n' + 'texttexttexttexttext'.grey + '!'.inverse.green + 'text'.grey + '!'.inverse.green + 'texttexttexttexttext'.grey;
130126

131127
diffLoger.getDiffText(inp, { charsAroundDiff: 20 }).must.be.eql(out);

0 commit comments

Comments
 (0)