Skip to content

Commit

Permalink
Use in check
Browse files Browse the repository at this point in the history
  • Loading branch information
Tofandel authored Aug 15, 2024
1 parent 12a0c83 commit c5340e9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ function getByPath<T extends SearchableObject, P extends PathEntry<T> & string>(
if (
typeof current !== 'object' ||
current === null ||
!current.hasOwnProperty(pathPart)
!(pathPart in current)
) {
return undefined
}
Expand Down Expand Up @@ -282,7 +282,7 @@ function setByPath<
if (
typeof current !== 'object' ||
current === null ||
!current.hasOwnProperty(pathPart)
!(pathPart in current)
) {
throwAssignmentError(current, pathPart)
}
Expand Down

0 comments on commit c5340e9

Please sign in to comment.