Skip to content

Commit a690004

Browse files
alan-agius4clydin
authored andcommitted
refactor: clean up old ansi-colors castings
This has been fixed in doowb/ansi-colors#44
1 parent e17015c commit a690004

File tree

6 files changed

+6
-12
lines changed

6 files changed

+6
-12
lines changed

packages/angular/cli/src/utilities/color.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ export function removeColor(text: string): string {
4545
}
4646

4747
// Create a separate instance to prevent unintended global changes to the color configuration
48-
// Create function is not defined in the typings. See: https://github.com/doowb/ansi-colors/pull/44
49-
const colors = (ansiColors as AnsiColors & { create: () => AnsiColors }).create();
48+
const colors = ansiColors.create();
5049
colors.enabled = supportColor();
5150

5251
export { colors };

packages/angular_devkit/architect_cli/bin/architect.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,7 @@ interface BarInfo {
7171
}
7272
7373
// Create a separate instance to prevent unintended global changes to the color configuration
74-
// Create function is not defined in the typings. See: https://github.com/doowb/ansi-colors/pull/44
75-
const colors = (ansiColors as typeof ansiColors & { create: () => typeof ansiColors }).create();
74+
const colors = ansiColors.create();
7675
7776
async function _executeTarget(
7877
parentLogger: logging.Logger,

packages/angular_devkit/benchmark/src/main.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,7 @@ export async function main({
111111
);
112112

113113
// Create a separate instance to prevent unintended global changes to the color configuration
114-
// Create function is not defined in the typings. See: https://github.com/doowb/ansi-colors/pull/44
115-
const colors = (ansiColors as typeof ansiColors & { create: () => typeof ansiColors }).create();
114+
const colors = ansiColors.create();
116115

117116
// Log to console.
118117
logger.pipe(filter((entry) => entry.level != 'debug' || argv['verbose'])).subscribe((entry) => {

packages/angular_devkit/build_angular/src/utils/color.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ export function removeColor(text: string): string {
4545
}
4646

4747
// Create a separate instance to prevent unintended global changes to the color configuration
48-
// Create function is not defined in the typings. See: https://github.com/doowb/ansi-colors/pull/44
49-
const colors = (ansiColors as AnsiColors & { create: () => AnsiColors }).create();
48+
const colors = ansiColors.create();
5049
colors.enabled = supportColor();
5150

5251
export { colors };

packages/angular_devkit/schematics_cli/bin/schematics.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,7 @@ export async function main({
117117
const { cliOptions, schematicOptions, _ } = parseArgs(args);
118118

119119
// Create a separate instance to prevent unintended global changes to the color configuration
120-
// Create function is not defined in the typings. See: https://github.com/doowb/ansi-colors/pull/44
121-
const colors = (ansiColors as typeof ansiColors & { create: () => typeof ansiColors }).create();
120+
const colors = ansiColors.create();
122121

123122
/** Create the DevKit Logger used through the CLI. */
124123
const logger = createConsoleLogger(!!cliOptions.verbose, stdout, stderr, {

tests/legacy-cli/e2e/utils/process.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ export type ProcessOutput = {
2727

2828
function _exec(options: ExecOptions, cmd: string, args: string[]): Promise<ProcessOutput> {
2929
// Create a separate instance to prevent unintended global changes to the color configuration
30-
// Create function is not defined in the typings. See: https://github.com/doowb/ansi-colors/pull/44
31-
const colors = (ansiColors as typeof ansiColors & { create: () => typeof ansiColors }).create();
30+
const colors = ansiColors.create();
3231

3332
let stdout = '';
3433
let stderr = '';

0 commit comments

Comments
 (0)