Skip to content

Commit e6b7bc9

Browse files
committed
some constructor cleanup
1 parent 692021b commit e6b7bc9

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

‎index.js‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,10 @@ class Pair {
115115

116116
class DiffOutput {
117117
constructor(args = {}) {
118-
Object.assign(this, Object.assign({
118+
Object.assign(this, {
119119
outputLines: []
120-
}, args))
120+
}, args)
121+
121122
this.gutterWidth = 0
122123
this.wrapWidth = colwidth
123124
}
@@ -130,9 +131,6 @@ class DiffOutput {
130131
}
131132

132133
class HunkHeader extends DiffOutput {
133-
constructor(args = {}) {
134-
super(args)
135-
}
136134
addLine(rawLine) {
137135
Array.prototype.push.apply(
138136
this.outputLines,
@@ -148,16 +146,16 @@ class HunkHeader extends DiffOutput {
148146
}
149147

150148
class HunkContent extends DiffOutput {
151-
constructor(args) {
149+
constructor(args = {}) {
152150
super(args)
153-
Object.assign(this, Object.assign({
151+
Object.assign(this, {
154152
lineNumbers: true,
155153
lineLength: 0,
156154
currentLineNumber: 0,
157155
changedLineColor: chalk.bgRgb(70, 70, 70),
158156
changedLineNumberColor: chalk.bgRgb(50, 50, 50),
159157
sanctioned: []
160-
}, args))
158+
}, args)
161159

162160
if(this.lineNumbers){
163161
this.lineNumberWidth = String(this.lineLength).length

0 commit comments

Comments
 (0)