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

hybridsjs / hybrids / 9387127968

05 Jun 2024 03:38PM UTC coverage: 46.684% (-53.3%) from 99.956%
9387127968

Pull #258

github

web-flow
Merge e936aa704 into 36d6e398d
Pull Request #258: feat: remove `content` property & add shadow mode detection to render property

611 of 1778 branches covered (34.36%)

69 of 97 new or added lines in 9 files covered. (71.13%)

1169 existing lines in 25 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

0.0
/src/parent.js
1
import { constructors } from "./define.js";
2

3
function walk(host, fn) {
UNCOV
4
  let parentElement = host.parentElement || host.parentNode.host;
×
5

UNCOV
6
  while (parentElement) {
×
UNCOV
7
    const hybrids = constructors.get(parentElement.constructor);
×
8

UNCOV
9
    if (hybrids && fn(hybrids, host)) {
×
UNCOV
10
      return parentElement;
×
11
    }
12

UNCOV
13
    parentElement =
×
14
      parentElement.parentElement ||
×
15
      (parentElement.parentNode && parentElement.parentNode.host);
16
  }
17

UNCOV
18
  return parentElement || null;
×
19
}
20

21
export default function parent(hybridsOrFn) {
22
  const fn =
UNCOV
23
    typeof hybridsOrFn === "function"
×
24
      ? hybridsOrFn
UNCOV
25
      : (hybrids) => hybrids === hybridsOrFn;
×
UNCOV
26
  return {
×
UNCOV
27
    value: (host) => walk(host, fn),
×
28
    connect(host, key, invalidate) {
UNCOV
29
      return invalidate;
×
30
    },
31
  };
32
}
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