File tree Expand file tree Collapse file tree 6 files changed +8
-7
lines changed Expand file tree Collapse file tree 6 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -6,8 +6,9 @@ const graphqlPackageJSON = JSON.parse(
66) ;
77
88const nodeVersions = graphqlPackageJSON . engines . node
9+ . replaceAll ( '^' , '' )
10+ . replaceAll ( '>=' , '' )
911 . split ( ' || ' )
10- . map ( ( version ) => version . replace ( '^' , '' ) . replace ( '>=' , '' ) )
1112 . sort ( ( a , b ) => b . localeCompare ( a ) ) ;
1213
1314for ( const version of nodeVersions ) {
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ export function dedentString(string: string): string {
1212 indent += char ;
1313 }
1414
15- return trimmedStr . replace ( RegExp ( '^' + indent , 'mg' ) , '' ) ; // remove indent
15+ return trimmedStr . replaceAll ( RegExp ( '^' + indent , 'mg' ) , '' ) ; // remove indent
1616}
1717
1818/**
Original file line number Diff line number Diff line change @@ -9,6 +9,6 @@ export function inspectStr(str: Maybe<string>): string {
99 }
1010 return JSON . stringify ( str )
1111 . replace ( / ^ " | " $ / g, '`' )
12- . replace ( / \\ " / g , '"' )
13- . replace ( / \\ \\ / g , '\\' ) ;
12+ . replaceAll ( ' \\"' , '"' )
13+ . replaceAll ( ' \\\\' , '\\' ) ;
1414}
Original file line number Diff line number Diff line change @@ -122,7 +122,7 @@ export function printBlockString(
122122 value : string ,
123123 options ?: { minimize ?: boolean } ,
124124) : string {
125- const escapedValue = value . replace ( / " " " / g , '\\"""' ) ;
125+ const escapedValue = value . replaceAll ( ' """' , '\\"""' ) ;
126126
127127 // Expand a block string's raw value into independent lines.
128128 const lines = escapedValue . split ( / \r \n | [ \n \r ] / g) ;
Original file line number Diff line number Diff line change @@ -370,7 +370,7 @@ function wrap(
370370}
371371
372372function indent ( str : string ) : string {
373- return wrap ( ' ' , str . replace ( / \n / g , '\n ' ) ) ;
373+ return wrap ( ' ' , str . replaceAll ( '\n' , '\n ' ) ) ;
374374}
375375
376376function hasMultilineItems ( maybeArray : Maybe < ReadonlyArray < string > > ) : boolean {
Original file line number Diff line number Diff line change @@ -317,5 +317,5 @@ function printDescription(
317317 const prefix =
318318 indentation && ! firstInBlock ? '\n' + indentation : indentation ;
319319
320- return prefix + blockString . replace ( / \n / g , '\n' + indentation ) + '\n' ;
320+ return prefix + blockString . replaceAll ( '\n' , '\n' + indentation ) + '\n' ;
321321}
You can’t perform that action at this time.
0 commit comments