mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-04-09 14:54:04 +02:00
Use Response.prototype.bytes() more in the code-base (PR 20651 follow-up)
This commit is contained in:
parent
aaf9b3bad0
commit
0c514b008b
@ -29,7 +29,7 @@ const response = await fetch(JPEG_IMAGE);
|
||||
if (!response.ok) {
|
||||
throw new Error(response.statusText);
|
||||
}
|
||||
const typedArrayImage = new Uint8Array(await response.arrayBuffer());
|
||||
const typedArrayImage = await response.bytes();
|
||||
|
||||
// Parse the image data using `JpegImage`.
|
||||
//
|
||||
|
||||
@ -85,8 +85,7 @@ async function writeStream(stream, buffer, transform) {
|
||||
.catch(() => {});
|
||||
|
||||
// Response::text doesn't return the correct data.
|
||||
const buf = await new Response(cs.readable).arrayBuffer();
|
||||
bytes = new Uint8Array(buf);
|
||||
bytes = await new Response(cs.readable).bytes();
|
||||
|
||||
let newFilter, newParams;
|
||||
if (!filter) {
|
||||
|
||||
@ -746,9 +746,7 @@ class SignatureExtractor {
|
||||
|
||||
writer.close();
|
||||
|
||||
const buf = await new Response(cs.readable).arrayBuffer();
|
||||
const bytes = new Uint8Array(buf);
|
||||
|
||||
const bytes = await new Response(cs.readable).bytes();
|
||||
return bytes.toBase64();
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user