Skip to content

Commit a7d5693

Browse files
committed
feat: make commit() and rollback() chainable
1 parent 2eb9275 commit a7d5693

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ export default class MagicStringStack implements MagicString {
4949
const newOne = new MagicString(this._current.toString(), this._options)
5050
this._current = newOne
5151
this._stack.unshift(newOne)
52+
return this
5253
}
5354

5455
/**
@@ -59,6 +60,7 @@ export default class MagicStringStack implements MagicString {
5960
throw new Error('Cannot rollback on the first commit')
6061
this._stack.shift()
6162
this._current = this._stack[0]
63+
return this
6264
}
6365

6466
get original() {

0 commit comments

Comments
 (0)