(input)
| 3532 | assert(dataURL.protocol === "data:"); |
| 3533 | let input = URLSerializer(dataURL, true); |
| 3534 | input = input.slice(5); |
| 3535 | const position = { position: 0 }; |
| 3536 | let mimeType = collectASequenceOfCodePointsFast( |
| 3537 | ",", |
| 3538 | input, |
| 3539 | position |
| 3540 | ); |
| 3541 | const mimeTypeLength = mimeType.length; |
| 3542 | mimeType = removeASCIIWhitespace(mimeType, true, true); |
| 3543 | if (position.position >= input.length) { |
| 3544 | return "failure"; |
| 3545 | } |
| 3546 | position.position++; |
| 3547 | const encodedBody = input.slice(mimeTypeLength + 1); |
| 3548 | let body = stringPercentDecode(encodedBody); |
| 3549 | if (/;(\u0020){0,}base64$/i.test(mimeType)) { |
| 3550 | const stringBody = isomorphicDecode(body); |
| 3551 | body = forgivingBase64(stringBody); |
| 3552 | if (body === "failure") { |
| 3553 | return "failure"; |
no test coverage detected