blob: deeca842e84fec91e4666ee77056c32dd459a289 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
'use strict'
class Indenter {
constructor (level, step) {
this.level = level
this.step = step
this.value = step.repeat(level)
}
increase () {
return new Indenter(this.level + 1, this.step)
}
decrease () {
return new Indenter(this.level - 1, this.step)
}
toString () {
return this.value
}
}
module.exports = Indenter
|