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

hybridsjs / hybrids / 9385835129

05 Jun 2024 02:19PM UTC coverage: 46.684% (-53.2%) from 99.911%
9385835129

Pull #258

github

web-flow
Merge 67d5f8f47 into 2b0c01bf9
Pull Request #258: feat: remove `content` property & add shadow mode detection to render property

611 of 1778 branches covered (34.36%)

54 of 78 new or added lines in 8 files covered. (69.23%)

1172 existing lines in 24 files now uncovered.

1049 of 2247 relevant lines covered (46.68%)

32.63 hits per line

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

90.0
/src/utils.js
1
const camelToDashMap = new Map();
2✔
2
export function camelToDash(str) {
3
  let result = camelToDashMap.get(str);
110✔
4
  if (result === undefined) {
110✔
5
    result = str.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
6✔
6
    camelToDashMap.set(str, result);
6✔
7
  }
8
  return result;
110✔
9
}
10

11
export function dispatch(host, eventType, options = {}) {
×
12
  return host.dispatchEvent(
37✔
13
    new globalThis.CustomEvent(eventType, { bubbles: false, ...options }),
14
  );
15
}
16

17
export function stringifyElement(target) {
UNCOV
18
  return `<${String(target.tagName).toLowerCase()}>`;
×
19
}
20

21
export function walkInShadow(target, cb) {
22
  if (target.nodeType === globalThis.Node.ELEMENT_NODE) {
46✔
23
    cb(target);
42✔
24

25
    if (target.shadowRoot) {
42!
UNCOV
26
      walkInShadow(target.shadowRoot, cb);
×
27
    }
28
  }
29

30
  const walker = globalThis.document.createTreeWalker(
46✔
31
    target,
32
    globalThis.NodeFilter.SHOW_ELEMENT,
33
    null,
34
    false,
35
  );
36

37
  while (walker.nextNode()) {
46✔
38
    const el = walker.currentNode;
785✔
39
    cb(el);
785✔
40
    if (el.shadowRoot) {
785✔
41
      walkInShadow(el.shadowRoot, cb);
4✔
42
    }
43
  }
44
}
45

46
export const deferred = Promise.resolve();
2✔
47
export const storePointer = new WeakMap();
2✔
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