1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-22 16:18:08 +02:00

Merge pull request #15752 from Snuffleupagus/no-typeof-undefined

Enable the `no-typeof-undefined` ESLint plugin rule
This commit is contained in:
Tim van der Meij 2022-12-02 19:48:16 +01:00 committed by GitHub
commit 99cfef882f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 8 additions and 9 deletions

View file

@ -1870,8 +1870,7 @@ class CanvasGraphics {
this.ctx.closePath();
}
stroke(consumePath) {
consumePath = typeof consumePath !== "undefined" ? consumePath : true;
stroke(consumePath = true) {
const ctx = this.ctx;
const strokeColor = this.current.strokeColor;
// For stroke we want to temporarily change the global alpha to the
@ -1904,8 +1903,7 @@ class CanvasGraphics {
this.stroke();
}
fill(consumePath) {
consumePath = typeof consumePath !== "undefined" ? consumePath : true;
fill(consumePath = true) {
const ctx = this.ctx;
const fillColor = this.current.fillColor;
const isPatternFill = this.current.patternFill;

View file

@ -46,7 +46,7 @@ function createHeaders(httpHeaders) {
const headers = new Headers();
for (const property in httpHeaders) {
const value = httpHeaders[property];
if (typeof value === "undefined") {
if (value === undefined) {
continue;
}
headers.append(property, value);

View file

@ -82,7 +82,7 @@ class NetworkManager {
xhr.withCredentials = this.withCredentials;
for (const property in this.httpHeaders) {
const value = this.httpHeaders[property];
if (typeof value === "undefined") {
if (value === undefined) {
continue;
}
xhr.setRequestHeader(property, value);

View file

@ -373,7 +373,7 @@ class PDFNodeStreamRangeReader extends BaseRangeReader {
this._httpHeaders = {};
for (const property in stream.httpHeaders) {
const value = stream.httpHeaders[property];
if (typeof value === "undefined") {
if (value === undefined) {
continue;
}
this._httpHeaders[property] = value;