Skip to content

Commit

Permalink
Remove Viewport.parse
Browse files Browse the repository at this point in the history
  • Loading branch information
inancgumus committed Nov 7, 2024
1 parent edc1e34 commit 380d03c
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions common/layout.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,24 +80,6 @@ type Viewport struct {
Height int64 `js:"height"`
}

// Parse viewport details from a given sobek viewport value.
func (v *Viewport) Parse(ctx context.Context, viewport sobek.Value) error {
rt := k6ext.Runtime(ctx)
if viewport != nil && !sobek.IsUndefined(viewport) && !sobek.IsNull(viewport) {
viewport := viewport.ToObject(rt)
for _, k := range viewport.Keys() {
switch k {
case "width":
v.Width = viewport.Get(k).ToInteger()
case "height":
v.Height = viewport.Get(k).ToInteger()
}
}
}

return nil
}

// IsEmpty returns true if the viewport is empty.
func (v Viewport) IsEmpty() bool {
return v.Width == 0 && v.Height == 0
Expand Down

0 comments on commit 380d03c

Please sign in to comment.