Skip to content

Commit

Permalink
suggestion change
Browse files Browse the repository at this point in the history
  • Loading branch information
tsctx committed Nov 30, 2023
1 parent de7eeee commit 99a9f09
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/fetch/dataURL.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function dataURLProcessor (dataURL) {
let input = URLSerializer(dataURL, true)

// 3. Remove the leading "data:" string from input.
input = input.substring(5)
input = input.slice(5)

// 4. Let position point at the start of input.
const position = { position: 0 }
Expand Down Expand Up @@ -59,7 +59,7 @@ function dataURLProcessor (dataURL) {
position.position++

// 9. Let encodedBody be the remainder of input.
const encodedBody = input.substring(mimeTypeLength + 1)
const encodedBody = input.slice(mimeTypeLength + 1)

// 10. Let body be the percent-decoding of encodedBody.
let body = stringPercentDecode(encodedBody)
Expand Down Expand Up @@ -165,11 +165,11 @@ function collectASequenceOfCodePointsFast (char, input, position) {

if (idx === -1) {
position.position = input.length
return input.substring(start)
return input.slice(start)
}

position.position = idx
return input.substring(start, position.position)
return input.slice(start, position.position)
}

// https://url.spec.whatwg.org/#string-percent-decode
Expand Down Expand Up @@ -515,7 +515,7 @@ function collectAnHTTPQuotedString (input, position, extractValue) {

// 7. Return the code points from positionStart to position,
// inclusive, within input.
return input.substring(positionStart, position.position)
return input.slice(positionStart, position.position)
}

/**
Expand Down

0 comments on commit 99a9f09

Please sign in to comment.