File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed
Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ const ESCAPES = new Set([27, 155]);
77const CODE_POINT_0 = '0' . codePointAt ( 0 ) ;
88const CODE_POINT_9 = '9' . codePointAt ( 0 ) ;
99
10+ const MAX_ANSI_SEQUENCE_LENGTH = 19 ;
11+
1012const endCodesSet = new Set ( ) ;
1113const endCodesMap = new Map ( ) ;
1214for ( const [ start , end ] of ansiStyles . codes ) {
@@ -48,7 +50,7 @@ function findNumberIndex(string) {
4850}
4951
5052function parseAnsiCode ( string , offset ) {
51- string = string . slice ( offset , offset + 19 ) ;
53+ string = string . slice ( offset , offset + MAX_ANSI_SEQUENCE_LENGTH ) ;
5254 const startIndex = findNumberIndex ( string ) ;
5355 if ( startIndex !== - 1 ) {
5456 let endIndex = string . indexOf ( 'm' , startIndex ) ;
Original file line number Diff line number Diff line change 1010 "types" : " ./index.d.ts" ,
1111 "default" : " ./index.js"
1212 },
13+ "sideEffects" : false ,
1314 "engines" : {
1415 "node" : " >=18"
1516 },
You can’t perform that action at this time.
0 commit comments