File tree 3 files changed +3
-3
lines changed
3 files changed +3
-3
lines changed Original file line number Diff line number Diff line change 5
5
function format ( objURL ) {
6
6
let protocol = objURL . protocol || "" ;
7
7
8
- if ( protocol && protocol . substr ( - 1 ) !== ":" ) {
8
+ if ( protocol && ! protocol . endsWith ( ":" ) ) {
9
9
protocol += ":" ;
10
10
}
11
11
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ function parseURL(resourceQuery) {
9
9
let options = { } ;
10
10
11
11
if ( typeof resourceQuery === "string" && resourceQuery !== "" ) {
12
- const searchParams = resourceQuery . substr ( 1 ) . split ( "&" ) ;
12
+ const searchParams = resourceQuery . slice ( 1 ) . split ( "&" ) ;
13
13
14
14
for ( let i = 0 ; i < searchParams . length ; i ++ ) {
15
15
const pair = searchParams [ i ] . split ( "=" ) ;
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ describe("'Range' header", () => {
42
42
) ;
43
43
expect ( responseRange . headers [ "content-length" ] ) . toBe ( "500" ) ;
44
44
expect ( responseRange . headers [ "content-range" ] ) . toMatch ( / ^ b y t e s 0 - 4 9 9 \/ / ) ;
45
- expect ( responseRange . text ) . toBe ( responseContent . substr ( 0 , 500 ) ) ;
45
+ expect ( responseRange . text ) . toBe ( responseContent . slice ( 0 , 500 ) ) ;
46
46
expect ( responseRange . text . length ) . toBe ( 500 ) ;
47
47
} ) ;
48
48
You can’t perform that action at this time.
0 commit comments