Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (supportsColor.hasBasic) {
const level: number = supportsColor.level;
console.log('Terminal has basic color support', level);
}
if (supportsColor.has256) {
console.log('Terminal supports 256 colors');
}
if (supportsColor.has16m) {
console.log('Terminal supports 16 million colors (truecolor)');
}
// $ExpectError
supportsColor.nope;
// $ExpectError
(supportsColor.level: string);
}