mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-06-12 05:01:03 +02:00
Enable the prefer-object-has-own ESLint rule
Please see https://eslint.org/docs/latest/rules/prefer-object-has-own
This commit is contained in:
parent
1bd4c4fbde
commit
f09b03c062
@ -262,6 +262,7 @@ export default [
|
||||
"no-useless-concat": "error",
|
||||
"no-useless-escape": "error",
|
||||
"no-useless-return": "error",
|
||||
"prefer-object-has-own": "error",
|
||||
"prefer-promise-reject-errors": "error",
|
||||
"prefer-spread": "error",
|
||||
"wrap-iife": ["error", "any"],
|
||||
|
||||
@ -953,18 +953,15 @@ class TreeView {
|
||||
val !== null &&
|
||||
typeof val === "object" &&
|
||||
!Array.isArray(val) &&
|
||||
Object.prototype.hasOwnProperty.call(val, "dict") &&
|
||||
(Object.prototype.hasOwnProperty.call(val, "bytes") ||
|
||||
Object.prototype.hasOwnProperty.call(val, "imageData") ||
|
||||
Object.hasOwn(val, "dict") &&
|
||||
(Object.hasOwn(val, "bytes") ||
|
||||
Object.hasOwn(val, "imageData") ||
|
||||
val.contentStream === true)
|
||||
);
|
||||
}
|
||||
|
||||
#isImageStream(val) {
|
||||
return (
|
||||
this.#isStream(val) &&
|
||||
Object.prototype.hasOwnProperty.call(val, "imageData")
|
||||
);
|
||||
return this.#isStream(val) && Object.hasOwn(val, "imageData");
|
||||
}
|
||||
|
||||
#isFormXObjectStream(val) {
|
||||
@ -977,7 +974,7 @@ class TreeView {
|
||||
val !== null &&
|
||||
typeof val === "object" &&
|
||||
!Array.isArray(val) &&
|
||||
Object.prototype.hasOwnProperty.call(val, "dict") &&
|
||||
Object.hasOwn(val, "dict") &&
|
||||
val.psFunction === true
|
||||
);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user