mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 01:10:08 +02:00
Use shorter arrow functions where possible
For arrow functions that are both simple and short, we can avoid using explicit `return` to shorten them even further without hurting readability. For the `gulp mozcentral` build-target this reduces the overall size of the output by just under 1 kilo-byte (which isn't a lot but still can't hurt).
This commit is contained in:
parent
6e46304357
commit
9dfe9c552c
22 changed files with 78 additions and 169 deletions
|
@ -326,11 +326,11 @@ class PDFNodeStreamFullReader extends BaseFullReader {
|
|||
this._headersCapability.resolve();
|
||||
this._setReadableStream(response);
|
||||
|
||||
const getResponseHeader = name => {
|
||||
// Make sure that headers name are in lower case, as mentioned
|
||||
// here: https://nodejs.org/api/http.html#http_message_headers.
|
||||
return this._readableStream.headers[name.toLowerCase()];
|
||||
};
|
||||
// Make sure that headers name are in lower case, as mentioned
|
||||
// here: https://nodejs.org/api/http.html#http_message_headers.
|
||||
const getResponseHeader = name =>
|
||||
this._readableStream.headers[name.toLowerCase()];
|
||||
|
||||
const { allowRangeRequests, suggestedLength } =
|
||||
validateRangeRequestCapabilities({
|
||||
getResponseHeader,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue