diff --git a/package.json b/package.json index 85d1630..98c314d 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,10 @@ "eslintConfig": { "extends": [ "./node_modules/kcd-scripts/eslint.js" - ] + ], + "rules": { + "prefer-object-has-own": "off" + } }, "eslintIgnore": [ "node_modules", diff --git a/src/index.ts b/src/index.ts index 1989088..7972c0e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -368,7 +368,7 @@ function getItemValues( value = key(item) } else if (item == null) { value = null - } else if (Object.hasOwn(item, key)) { + } else if (Object.hasOwnProperty.call(item, key)) { value = (item as IndexableByString)[key] } else if (key.includes('.')) { // eslint-disable-next-line @typescript-eslint/no-unsafe-call @@ -412,7 +412,7 @@ function getNestedValues( if (nestedItem == null) continue - if (Object.hasOwn(nestedItem as object, nestedKey)) { + if (Object.hasOwnProperty.call(nestedItem, nestedKey)) { const nestedValue = (nestedItem as IndexableByString)[nestedKey] if (nestedValue != null) { nestedValues.push(nestedValue as IndexableByString | string)