refactor: clean up old ansi-colors castings

This has been fixed in https://github.com/doowb/ansi-colors/pull/44
This commit is contained in:
Alan Agius 2022-06-28 10:51:29 +00:00 committed by Charles
parent e17015ceff
commit a69000407c
6 changed files with 6 additions and 12 deletions

View File

@ -45,8 +45,7 @@ export function removeColor(text: string): string {
} }
// Create a separate instance to prevent unintended global changes to the color configuration // Create a separate instance to prevent unintended global changes to the color configuration
// Create function is not defined in the typings. See: https://github.com/doowb/ansi-colors/pull/44 const colors = ansiColors.create();
const colors = (ansiColors as AnsiColors & { create: () => AnsiColors }).create();
colors.enabled = supportColor(); colors.enabled = supportColor();
export { colors }; export { colors };

View File

@ -71,8 +71,7 @@ interface BarInfo {
} }
// Create a separate instance to prevent unintended global changes to the color configuration // Create a separate instance to prevent unintended global changes to the color configuration
// Create function is not defined in the typings. See: https://github.com/doowb/ansi-colors/pull/44 const colors = ansiColors.create();
const colors = (ansiColors as typeof ansiColors & { create: () => typeof ansiColors }).create();
async function _executeTarget( async function _executeTarget(
parentLogger: logging.Logger, parentLogger: logging.Logger,

View File

@ -111,8 +111,7 @@ export async function main({
); );
// Create a separate instance to prevent unintended global changes to the color configuration // Create a separate instance to prevent unintended global changes to the color configuration
// Create function is not defined in the typings. See: https://github.com/doowb/ansi-colors/pull/44 const colors = ansiColors.create();
const colors = (ansiColors as typeof ansiColors & { create: () => typeof ansiColors }).create();
// Log to console. // Log to console.
logger.pipe(filter((entry) => entry.level != 'debug' || argv['verbose'])).subscribe((entry) => { logger.pipe(filter((entry) => entry.level != 'debug' || argv['verbose'])).subscribe((entry) => {

View File

@ -45,8 +45,7 @@ export function removeColor(text: string): string {
} }
// Create a separate instance to prevent unintended global changes to the color configuration // Create a separate instance to prevent unintended global changes to the color configuration
// Create function is not defined in the typings. See: https://github.com/doowb/ansi-colors/pull/44 const colors = ansiColors.create();
const colors = (ansiColors as AnsiColors & { create: () => AnsiColors }).create();
colors.enabled = supportColor(); colors.enabled = supportColor();
export { colors }; export { colors };

View File

@ -117,8 +117,7 @@ export async function main({
const { cliOptions, schematicOptions, _ } = parseArgs(args); const { cliOptions, schematicOptions, _ } = parseArgs(args);
// Create a separate instance to prevent unintended global changes to the color configuration // Create a separate instance to prevent unintended global changes to the color configuration
// Create function is not defined in the typings. See: https://github.com/doowb/ansi-colors/pull/44 const colors = ansiColors.create();
const colors = (ansiColors as typeof ansiColors & { create: () => typeof ansiColors }).create();
/** Create the DevKit Logger used through the CLI. */ /** Create the DevKit Logger used through the CLI. */
const logger = createConsoleLogger(!!cliOptions.verbose, stdout, stderr, { const logger = createConsoleLogger(!!cliOptions.verbose, stdout, stderr, {

View File

@ -27,8 +27,7 @@ export type ProcessOutput = {
function _exec(options: ExecOptions, cmd: string, args: string[]): Promise<ProcessOutput> { function _exec(options: ExecOptions, cmd: string, args: string[]): Promise<ProcessOutput> {
// Create a separate instance to prevent unintended global changes to the color configuration // Create a separate instance to prevent unintended global changes to the color configuration
// Create function is not defined in the typings. See: https://github.com/doowb/ansi-colors/pull/44 const colors = ansiColors.create();
const colors = (ansiColors as typeof ansiColors & { create: () => typeof ansiColors }).create();
let stdout = ''; let stdout = '';
let stderr = ''; let stderr = '';