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

hybridsjs / hybrids / 15632006239

13 Jun 2025 10:06AM UTC coverage: 99.914%. Remained the same
15632006239

push

github

smalluban
chore(release): 9.1.18

1830 of 1838 branches covered (99.56%)

2335 of 2337 relevant lines covered (99.91%)

147.06 hits per line

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

100.0
/src/render.js
1
export default function render(desc) {
2
  if (desc.reflect) {
48✔
3
    throw TypeError(`'reflect' option is not supported for 'render' property`);
1✔
4
  }
5

6
  const { value: fn, observe } = desc;
47✔
7

8
  if (typeof fn !== "function") {
47✔
9
    throw TypeError(
1✔
10
      `Value for 'render' property must be a function: ${typeof fn}`,
11
    );
12
  }
13

14
  const result = {
46✔
15
    connect: desc.connect,
16
    observe: observe
46✔
17
      ? (host, flush, lastFlush) => {
18
          observe(host, flush(), lastFlush);
1✔
19
        }
20
      : (host, flush) => {
21
          flush();
185✔
22
        },
23
  };
24

25
  const shadow = desc.shadow
46✔
26
    ? {
27
        mode: desc.shadow.mode || "open",
8✔
28
        delegatesFocus: desc.shadow.delegatesFocus || false,
7✔
29
      }
30
    : desc.shadow;
31

32
  if (shadow) {
46✔
33
    result.value = (host) => {
4✔
34
      const target = host.shadowRoot || host.attachShadow(shadow);
10✔
35
      const update = fn(host);
10✔
36

37
      return () => {
10✔
38
        update(host, target);
10✔
39
        return target;
10✔
40
      };
41
    };
42
  } else if (shadow === false) {
42✔
43
    result.value = (host) => {
1✔
44
      const update = fn(host);
1✔
45
      return () => {
1✔
46
        update(host, host);
1✔
47
        return host;
1✔
48
      };
49
    };
50
  } else {
51
    result.value = (host) => {
41✔
52
      const update = fn(host);
175✔
53
      return () => update(host);
189✔
54
    };
55
  }
56

57
  return result;
46✔
58
}
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