Skip to content

Commit e9c59ec

Browse files
committed
style: prefer Array.from over fill().map()
1 parent 3de276c commit e9c59ec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

testing.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ func (v *VHS) SaveOutput() error {
6767
// Buffer returns the current buffer.
6868
func (v *VHS) Buffer() ([]string, error) {
6969
// Get the current buffer.
70-
buf, err := v.Page.Eval("() => Array(term.rows).fill(0).map((_, i) => term.buffer.active.getLine(i + term.buffer.active.viewportY).translateToString().trimEnd())")
70+
buf, err := v.Page.Eval("() => Array.from({ length: term.rows }, (_, i) => term.buffer.active.getLine(i + term.buffer.active.viewportY).translateToString().trimEnd())")
7171
if err != nil {
7272
return nil, fmt.Errorf("read buffer: %w", err)
7373
}

0 commit comments

Comments
 (0)