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:
Jonas Jenwald 2026-04-02 13:24:31 +02:00
parent 1bd4c4fbde
commit f09b03c062
2 changed files with 6 additions and 8 deletions

View File

@ -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"],

View File

@ -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
);
}