diff --git a/src/index.ts b/src/index.ts index 8c0423f..f79f5d6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -237,7 +237,7 @@ function getByPath & string>( if ( typeof current !== 'object' || current === null || - !current.hasOwnProperty(pathPart) + !(pathPart in current) ) { return undefined } @@ -282,7 +282,7 @@ function setByPath< if ( typeof current !== 'object' || current === null || - !current.hasOwnProperty(pathPart) + !(pathPart in current) ) { throwAssignmentError(current, pathPart) }