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

atinc / ngx-tethys / d9ae709b-3c27-4b69-b125-b8b80b54f90b

pending completion
d9ae709b-3c27-4b69-b125-b8b80b54f90b

Pull #2757

circleci

mengshuicmq
fix: fix code review
Pull Request #2757: feat(color-picker): color-picker support disabled (#INFR-8645)

98 of 6315 branches covered (1.55%)

Branch coverage included in aggregate %.

1 of 1 new or added line in 1 file covered. (100.0%)

2392 of 13661 relevant lines covered (17.51%)

83.12 hits per line

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

25.81
/src/util/logger/logger.ts
1
import { isDevMode } from '@angular/core';
2

1✔
3
const record: Record<string, boolean> = {};
1✔
4

1✔
5
let logWarnDeprecation = true;
6

×
7
export const PREFIX = '[NGX-TETHYS]:';
×
8

×
9
function notRecorded(...args: any[]): boolean {
10
    const asRecord = args.reduce((acc, c) => acc + c.toString(), '');
11

×
12
    if (record[asRecord]) {
×
13
        return false;
14
    } else {
15
        record[asRecord] = true;
16
        return true;
×
17
    }
×
18
}
19

20
function consoleCommonBehavior(consoleFunc: (...args: any) => void, ...args: any[]): void {
21
    if (isDevMode() && notRecorded(...args)) {
1✔
22
        consoleFunc(...args);
23
    }
1✔
24
}
×
25

×
26
// Warning should only be printed in dev mode and only once.
×
27
export const warn = (...args: any[]) => consoleCommonBehavior((...arg: any[]) => console.warn(PREFIX, ...arg), ...args);
×
28

29
export function createWarnDeprecation(prefix: string): (...args: any[]) => void {
30
    return (...args: any[]) => {
31
        const stack = new Error().stack;
32
        return consoleCommonBehavior((...arg: any[]) => {
1✔
33
            if (logWarnDeprecation) {
34
                console.warn(prefix, 'deprecated:', ...arg, stack);
1✔
35
            }
×
36
        }, ...args);
×
37
    };
38
}
39

40
export const warnDeprecation = createWarnDeprecation(PREFIX);
1✔
41

42
// Log should only be printed in dev mode.
43
export const log = (...args: any[]) => {
44
    if (isDevMode()) {
45
        console.log(PREFIX, ...args);
46
    }
47
};
48

49
export function setWarnDeprecation(enabled: boolean) {
50
    logWarnDeprecation = enabled;
51
}
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