File tree Expand file tree Collapse file tree 6 files changed +8
-6
lines changed Expand file tree Collapse file tree 6 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 1616
1717### Chore & Maintenance
1818
19+ - ` [*] ` Replaced ` substr ` method with ` substring ` ([ #12066 ] ( https://github.com/facebook/jest/pull/12066 ) )
20+
1921### Performance
2022
2123## 27.3.1
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ export const replaceRootDirInPath = (
6565
6666 return path . resolve (
6767 rootDir ,
68- path . normalize ( './' + filePath . substr ( '<rootDir>' . length ) ) ,
68+ path . normalize ( './' + filePath . substring ( '<rootDir>' . length ) ) ,
6969 ) ;
7070} ;
7171
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import * as path from 'path';
1010// rootDir and filename must be absolute paths (resolved)
1111export function relative ( rootDir : string , filename : string ) : string {
1212 return filename . indexOf ( rootDir + path . sep ) === 0
13- ? filename . substr ( rootDir . length + 1 )
13+ ? filename . substring ( rootDir . length + 1 )
1414 : path . relative ( rootDir , filename ) ;
1515}
1616
Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ export async function worker(data: WorkerMessage): Promise<WorkerMetadata> {
6363 } catch ( err : any ) {
6464 throw new Error ( `Cannot parse ${ filePath } as JSON: ${ err . message } ` ) ;
6565 }
66- } else if ( ! blacklist . has ( filePath . substr ( filePath . lastIndexOf ( '.' ) ) ) ) {
66+ } else if ( ! blacklist . has ( filePath . substring ( filePath . lastIndexOf ( '.' ) ) ) ) {
6767 // Process a random file that is returned as a MODULE.
6868 if ( hasteImpl ) {
6969 id = hasteImpl . getHasteName ( filePath ) ;
Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ function stripAddedIndentation(inlineSnapshot: string) {
9999 return inlineSnapshot ;
100100 }
101101
102- lines [ i ] = lines [ i ] . substr ( indentation . length ) ;
102+ lines [ i ] = lines [ i ] . substring ( indentation . length ) ;
103103 }
104104 }
105105
Original file line number Diff line number Diff line change @@ -876,9 +876,9 @@ function readCodeCacheFile(cachePath: Config.Path): string | null {
876876 if ( content == null ) {
877877 return null ;
878878 }
879- const code = content . substr ( 33 ) ;
879+ const code = content . substring ( 33 ) ;
880880 const checksum = createHash ( 'md5' ) . update ( code ) . digest ( 'hex' ) ;
881- if ( checksum === content . substr ( 0 , 32 ) ) {
881+ if ( checksum === content . substring ( 0 , 32 ) ) {
882882 return code ;
883883 }
884884 return null ;
You can’t perform that action at this time.
0 commit comments