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

atomicpages / pretty-checkbox-react / 10633918906

30 Aug 2024 01:53PM UTC coverage: 100.0%. Remained the same
10633918906

Pull #1156

github

web-flow
build(deps): bump micromatch from 4.0.4 to 4.0.8 in /docs

Bumps [micromatch](https://github.com/micromatch/micromatch) from 4.0.4 to 4.0.8.
- [Release notes](https://github.com/micromatch/micromatch/releases)
- [Changelog](https://github.com/micromatch/micromatch/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micromatch/micromatch/compare/4.0.4...4.0.8)

---
updated-dependencies:
- dependency-name: micromatch
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Pull Request #1156: build(deps): bump micromatch from 4.0.4 to 4.0.8 in /docs

67 of 67 branches covered (100.0%)

Branch coverage included in aggregate %.

172 of 172 relevant lines covered (100.0%)

9.99 hits per line

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

100.0
/src/hooks/useIcon.ts
1
import * as React from 'react';
4✔
2
import clsx from 'clsx';
4✔
3

4
import { PCRCheckboxRadioProps } from '../typings/PCRCheckboxRadioProps';
5

6
export const useIcon = (icon: PCRCheckboxRadioProps['icon']) => {
4✔
7
  return React.useMemo(() => {
33✔
8
    if (icon) {
18✔
9
      let type: 'icon' | 'svg' | 'image' = 'icon';
5✔
10

11
      if (icon.type === 'img') {
5✔
12
        type = 'image';
1✔
13
      } else if (icon.type === 'svg') {
4✔
14
        type = 'svg';
1✔
15
      }
16

17
      // icons that contain `type` substring
18
      // won't fail with a word boundary search
19
      const re = new RegExp(`\\b${type}\\b`);
5✔
20

21
      return {
5✔
22
        iconType: icon.props['data-type'] || type,
10✔
23
        icon:
24
          icon.props.className && !re.test(icon.props.className)
14✔
25
            ? React.cloneElement(icon, {
26
                ...icon.props,
27
                className: clsx(icon.props.className, type),
28
              })
29
            : icon,
30
      };
31
    }
32

33
    return {};
13✔
34
  }, [icon]);
35
};
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

© 2025 Coveralls, Inc