MCPcopy
hub / github.com/vercel/next.js / getComputed

Function getComputed

test/integration/next-image-new/base-path/test/index.test.ts:35–48  ·  view source on GitHub ↗
(browser, id, prop)

Source from the content-addressed store, hash-verified

33}
34
35async function getComputed(browser, id, prop) {
36 const val = await browser.eval(`document.getElementById('${id}').${prop}`)
37 if (typeof val === 'number') {
38 return val
39 }
40 if (typeof val === 'string') {
41 const v = parseInt(val, 10)
42 if (isNaN(v)) {
43 return val
44 }
45 return v
46 }
47 return null
48}
49
50function getRatio(width, height) {
51 return height / width

Callers 1

runTestsFunction · 0.70

Calls 3

evalMethod · 0.80
parseIntFunction · 0.50
isNaNFunction · 0.50

Tested by

no test coverage detected