File tree Expand file tree Collapse file tree 5 files changed +20
-10
lines changed
@isaacs/cliui/node_modules/strip-ansi
wrap-ansi/node_modules/strip-ansi Expand file tree Collapse file tree 5 files changed +20
-10
lines changed Original file line number Diff line number Diff line change 11import ansiRegex from 'ansi-regex' ;
22
3+ const regex = ansiRegex ( ) ;
4+
35export default function stripAnsi ( string ) {
46 if ( typeof string !== 'string' ) {
57 throw new TypeError ( `Expected a \`string\`, got \`${ typeof string } \`` ) ;
68 }
79
8- return string . replace ( ansiRegex ( ) , '' ) ;
10+ // Even though the regex is global, we don't need to reset the `.lastIndex`
11+ // because unlike `.exec()` and `.test()`, `.replace()` does it automatically
12+ // and doing it manually has a performance penalty.
13+ return string . replace ( regex , '' ) ;
914}
Original file line number Diff line number Diff line change 11{
22 "name" : " strip-ansi" ,
3- "version" : " 7.0.1 " ,
3+ "version" : " 7.1.0 " ,
44 "description" : " Strip ANSI escape codes from a string" ,
55 "license" : " MIT" ,
66 "repository" : " chalk/strip-ansi" ,
Original file line number Diff line number Diff line change 11import ansiRegex from 'ansi-regex' ;
22
3+ const regex = ansiRegex ( ) ;
4+
35export default function stripAnsi ( string ) {
46 if ( typeof string !== 'string' ) {
57 throw new TypeError ( `Expected a \`string\`, got \`${ typeof string } \`` ) ;
68 }
79
8- return string . replace ( ansiRegex ( ) , '' ) ;
10+ // Even though the regex is global, we don't need to reset the `.lastIndex`
11+ // because unlike `.exec()` and `.test()`, `.replace()` does it automatically
12+ // and doing it manually has a performance penalty.
13+ return string . replace ( regex , '' ) ;
914}
Original file line number Diff line number Diff line change 11{
22 "name" : " strip-ansi" ,
3- "version" : " 7.0.1 " ,
3+ "version" : " 7.1.0 " ,
44 "description" : " Strip ANSI escape codes from a string" ,
55 "license" : " MIT" ,
66 "repository" : " chalk/strip-ansi" ,
Original file line number Diff line number Diff line change 13291329 }
13301330 },
13311331 "node_modules/@isaacs/cliui/node_modules/strip-ansi": {
1332- "version": "7.0.1 ",
1333- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1 .tgz",
1334- "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw ==",
1332+ "version": "7.1.0 ",
1333+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0 .tgz",
1334+ "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ ==",
13351335 "inBundle": true,
13361336 "dependencies": {
13371337 "ansi-regex": "^6.0.1"
1523115231 }
1523215232 },
1523315233 "node_modules/wrap-ansi/node_modules/strip-ansi": {
15234- "version": "7.0.1 ",
15235- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1 .tgz",
15236- "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw ==",
15234+ "version": "7.1.0 ",
15235+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0 .tgz",
15236+ "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ ==",
1523715237 "inBundle": true,
1523815238 "dependencies": {
1523915239 "ansi-regex": "^6.0.1"
You can’t perform that action at this time.
0 commit comments