Skip to content

Commit

Permalink
chore(deps): use strip-ansi
Browse files Browse the repository at this point in the history
  • Loading branch information
SoonIter committed Apr 28, 2024
1 parent b64ce45 commit 6fb9c54
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
12 changes: 1 addition & 11 deletions e2e/cases/assets-retry/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,7 @@ import { pluginAssetsRetry } from '@rsbuild/plugin-assets-retry';
import type { PluginAssetsRetryOptions } from '@rsbuild/plugin-assets-retry';
import { pluginReact } from '@rsbuild/plugin-react';
import type { RequestHandler } from '@rsbuild/shared';

const pattern = [
'[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)',
'(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))',
].join('|');

const ansiRegex = new RegExp(pattern, 'g');

function stripAnsi(content: string) {
return content.replace(ansiRegex, '');
}
import stripAnsi from 'strip-ansi';

function count404Response(logs: string[], urlPrefix: string): number {
let count = 0;
Expand Down
1 change: 1 addition & 0 deletions e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"vue-router": "^4.3.2"
},
"devDependencies": {
"strip-ansi": "6.0.1",
"@e2e/helper": "workspace:*",
"@playwright/test": "1.43.1",
"@rsbuild/babel-preset": "workspace:*",
Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

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

0 comments on commit 6fb9c54

Please sign in to comment.