• 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

96.15
/src/template/utils.js
1
const metaMap = new WeakMap();
2✔
2
export function getMeta(key) {
3
  let value = metaMap.get(key);
661✔
4
  if (value) return value;
661✔
5

6
  metaMap.set(key, (value = {}));
161✔
7
  return value;
161✔
8
}
9

10
export function getTemplateEnd(node) {
11
  let meta;
12

13
  while (node && (meta = getMeta(node)) && meta.endNode) {
134✔
UNCOV
14
    node = meta.endNode;
×
15
  }
16

17
  return node;
134✔
18
}
19

20
export function removeTemplate(target) {
21
  if (target.nodeType === globalThis.Node.TEXT_NODE) {
178✔
22
    const data = metaMap.get(target);
76✔
23

24
    if (data && data.startNode) {
76✔
25
      const endNode = getTemplateEnd(data.endNode);
43✔
26

27
      let node = data.startNode;
43✔
28
      const lastNextSibling = endNode.nextSibling;
43✔
29

30
      while (node) {
43✔
31
        const nextSibling = node.nextSibling;
43✔
32
        node.parentNode.removeChild(node);
43✔
33
        node = nextSibling !== lastNextSibling && nextSibling;
43!
34
      }
35
      metaMap.set(target, {});
43✔
36
    }
37
  } else {
38
    let child = target.childNodes[0];
102✔
39
    while (child) {
102✔
40
      target.removeChild(child);
39✔
41
      child = target.childNodes[0];
39✔
42
    }
43

44
    metaMap.set(target, {});
102✔
45
  }
46
}
47

48
const TIMESTAMP = Date.now();
2✔
49
export const getPlaceholder = (id = 0) => `H-${TIMESTAMP}-${id}`;
44✔
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