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

naver / egjs-flicking-plugins / 5530884421

pending completion
5530884421

push

github

daybrush
chore(release): Release 4.7.1

197 of 320 branches covered (61.56%)

Branch coverage included in aggregate %.

621 of 819 relevant lines covered (75.82%)

3.29 hits per line

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

56.67
/src/utils.ts
1
export const addClass = (el: HTMLElement, className: string) => {
1✔
2
  if (!el) return;
27!
3

4
  if (el.classList) {
27!
5
    el.classList.add(className);
27✔
6
  } else {
7
    const classes = el.className.split(" ");
×
8

9
    if (classes.indexOf(className) < 0) {
×
10
      el.className = `${el.className} ${className}`;
×
11
    }
12
  }
13
};
14

15
export const removeClass = (el: HTMLElement, className: string) => {
1✔
16
  if (!el) return;
10!
17

18
  if (el.classList) {
10!
19
    el.classList.remove(className);
10✔
20
  } else {
21
    const classRegex = new RegExp(`( |^)${className}( |$)`, "g");
×
22
    el.className.replace(classRegex, " ");
×
23
  }
24
};
25

26
export const getElement = (selector: string, parent: HTMLElement, pluginName: string) => {
1✔
27
  const el = parent.querySelector(selector);
2✔
28

29
  if (!el) {
2!
30
    throw new Error(`[Flicking-${pluginName}] Couldn't find element with the given selector: ${selector}`);
×
31
  }
32

33
  return el as HTMLElement;
2✔
34
};
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