Skip to content

Commit

Permalink
chore: remove strip-ansi
Browse files Browse the repository at this point in the history
  • Loading branch information
peternhale committed Aug 2, 2024
1 parent 47021f1 commit d1f4f87
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
1 change: 0 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion packages/salesforcedx-utils-vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"applicationinsights": "1.0.7",
"cross-spawn": "7.0.3",
"rxjs": "^5.4.1",
"strip-ansi": "^5.2.0",
"tree-kill": "^1.1.0"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/

import stripAnsi from 'strip-ansi';
import { OutputChannel, window } from 'vscode';
import { CommandExecution } from '../cli';
import { stripAnsi } from '../helpers/utils';
import { nls } from '../messages';
import { SettingsService } from '../settings';

Expand Down
6 changes: 5 additions & 1 deletion packages/salesforcedx-utils-vscode/src/helpers/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,11 @@ export const fileUtils = {
};

export const stripAnsiInJson = (str: string, hasJson: boolean): string => {
return hasJson ? str.replaceAll(ansiRegex(), '') : str;
return str && hasJson ? str.replaceAll(ansiRegex(), '') : str;
};

export const stripAnsi = (str: string): string => {
return str ? str.replaceAll(ansiRegex(), '') : str;
};

/*
Expand Down

0 comments on commit d1f4f87

Please sign in to comment.