Skip to content

Commit f9bb6d0

Browse files
committed
Prefer Array.from over fill().map() pattern
1 parent 1e9b79b commit f9bb6d0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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)