• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

prebid / Prebid.js / 18136225893

30 Sep 2025 04:07PM UTC coverage: 96.245% (+0.006%) from 96.239%
18136225893

push

github

web-flow
Advertising Bid Adapter: Update the regex while parsing bid.impid to support the change to UUID format for bid ids (#13879)

51890 of 63472 branches covered (81.75%)

1 of 1 new or added line in 1 file covered. (100.0%)

70 existing lines in 12 files now uncovered.

198517 of 206262 relevant lines covered (96.25%)

125.12 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

95.24
/src/utils/winDimensions.js
1
import {canAccessWindowTop, internal as utilsInternals} from '../utils.js';
2

3
const CHECK_INTERVAL_MS = 20;
4✔
4

5
export function cachedGetter(getter) {
6
  let value, lastCheckTimestamp;
7
  return {
7✔
8
    get: function () {
9
      if (!value || !lastCheckTimestamp || (Date.now() - lastCheckTimestamp > CHECK_INTERVAL_MS)) {
3,261✔
10
        value = getter();
344✔
11
        lastCheckTimestamp = Date.now();
344✔
12
      }
13
      return value;
3,261✔
14
    },
15
    reset: function () {
16
      value = getter();
358✔
17
    }
18
  }
19
}
20

21
function fetchWinDimensions() {
22
  const top = canAccessWindowTop() ? utilsInternals.getWindowTop() : utilsInternals.getWindowSelf();
510✔
23

24
  return {
510✔
25
    screen: {
26
      width: top.screen?.width,
1,530✔
27
      height: top.screen?.height
1,530✔
28
    },
29
    innerHeight: top.innerHeight,
30
    innerWidth: top.innerWidth,
31
    visualViewport: {
32
      height: top.visualViewport?.height,
1,530✔
33
      width: top.visualViewport?.width,
1,530✔
34
    },
35
    document: {
36
      documentElement: {
37
        clientWidth: top.document?.documentElement?.clientWidth,
2,456✔
38
        clientHeight: top.document?.documentElement?.clientHeight,
2,456✔
39
        scrollTop: top.document?.documentElement?.scrollTop,
2,456✔
40
        scrollLeft: top.document?.documentElement?.scrollLeft,
2,456✔
41
      },
42
      body: {
43
        scrollTop: document.body?.scrollTop,
1,530!
44
        scrollLeft: document.body?.scrollLeft,
1,530!
45
        clientWidth: document.body?.clientWidth,
1,530!
46
        clientHeight: document.body?.clientHeight,
1,530!
47
      },
48
    }
49
  };
50
}
51
export const internal = {
4✔
52
  fetchWinDimensions,
53
  resetters: []
54
};
55

56
const winDimensions = cachedGetter(() => internal.fetchWinDimensions());
510✔
57

58
export const getWinDimensions = winDimensions.get;
4✔
59
internal.resetters.push(winDimensions.reset);
4✔
60

61
export function resetWinDimensions() {
62
  internal.resetters.forEach(fn => fn());
358✔
63
}
64

65
export function getScreenOrientation(win) {
66
  const fallbackWin = win ?? (canAccessWindowTop() ? utilsInternals.getWindowTop() : utilsInternals.getWindowSelf());
67!
67
  const screenData = fallbackWin?.screen ?? utilsInternals.getWindowSelf()?.screen ?? window?.screen;
67!
68
  const width = Number(screenData?.width);
67!
69
  const height = Number(screenData?.height);
67!
70

71
  if (!Number.isFinite(width) || !Number.isFinite(height)) {
67!
UNCOV
72
    return;
×
73
  }
74

75
  return height >= width ? 'portrait' : 'landscape';
67!
76
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc