github
1727 of 2208 branches covered (78.22%)
Branch coverage included in aggregate %.
4 of 557 new or added lines in 6 files covered. (0.72%)
8166 of 10408 relevant lines covered (78.46%)
114.65 hits per line
|
NEW
|
import os from "os";
|
|
| 2 |
|
|
| 3 |
export type Platform = "mac" | "windows" | "linux"; |
|
|
NEW
|
export const getPlatform = (): Platform | null => { |
× |
|
NEW
|
switch (os.platform()) {
|
× |
|
NEW
|
case "win32": |
× |
|
NEW
|
return "windows"; |
× |
|
NEW
|
case "darwin": |
× |
|
NEW
|
return "mac"; |
× |
|
NEW
|
case "linux": |
× |
|
NEW
|
return "linux"; |
× |
|
NEW
|
default:
|
× |
|
NEW
|
return null;
|
× |
|
NEW
|
} |
× |
|
NEW
|
}; |
× |
| 16 |
|
|
|
NEW
|
export const formatError = (error: unknown): string => (error instanceof Error ? error.message : String(error)); |
× |