mirror of
https://github.com/angular/angular-cli.git
synced 2025-05-15 01:54:04 +08:00
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:
parent
e17015ceff
commit
a69000407c
@ -45,8 +45,7 @@ export function removeColor(text: string): string {
|
||||
}
|
||||
|
||||
// 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 as AnsiColors & { create: () => AnsiColors }).create();
|
||||
const colors = ansiColors.create();
|
||||
colors.enabled = supportColor();
|
||||
|
||||
export { colors };
|
||||
|
@ -71,8 +71,7 @@ interface BarInfo {
|
||||
}
|
||||
|
||||
// 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 as typeof ansiColors & { create: () => typeof ansiColors }).create();
|
||||
const colors = ansiColors.create();
|
||||
|
||||
async function _executeTarget(
|
||||
parentLogger: logging.Logger,
|
||||
|
@ -111,8 +111,7 @@ export async function main({
|
||||
);
|
||||
|
||||
// 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 as typeof ansiColors & { create: () => typeof ansiColors }).create();
|
||||
const colors = ansiColors.create();
|
||||
|
||||
// Log to console.
|
||||
logger.pipe(filter((entry) => entry.level != 'debug' || argv['verbose'])).subscribe((entry) => {
|
||||
|
@ -45,8 +45,7 @@ export function removeColor(text: string): string {
|
||||
}
|
||||
|
||||
// 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 as AnsiColors & { create: () => AnsiColors }).create();
|
||||
const colors = ansiColors.create();
|
||||
colors.enabled = supportColor();
|
||||
|
||||
export { colors };
|
||||
|
@ -117,8 +117,7 @@ export async function main({
|
||||
const { cliOptions, schematicOptions, _ } = parseArgs(args);
|
||||
|
||||
// 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 as typeof ansiColors & { create: () => typeof ansiColors }).create();
|
||||
const colors = ansiColors.create();
|
||||
|
||||
/** Create the DevKit Logger used through the CLI. */
|
||||
const logger = createConsoleLogger(!!cliOptions.verbose, stdout, stderr, {
|
||||
|
@ -27,8 +27,7 @@ export type 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 function is not defined in the typings. See: https://github.com/doowb/ansi-colors/pull/44
|
||||
const colors = (ansiColors as typeof ansiColors & { create: () => typeof ansiColors }).create();
|
||||
const colors = ansiColors.create();
|
||||
|
||||
let stdout = '';
|
||||
let stderr = '';
|
||||
|
Loading…
x
Reference in New Issue
Block a user