Skip to content

Commit

Permalink
feat: return null if the value was assigned null.
Browse files Browse the repository at this point in the history
  • Loading branch information
MAST1999 committed May 20, 2024
1 parent 3ffcb17 commit 50a016d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/form-core/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ export function functionalUpdate<TInput, TOutput = TInput>(
export function getBy(obj: any, path: any) {
const pathObj = makePathArray(path)
return pathObj.reduce((current: any, pathPart: any) => {
if (typeof current !== 'undefined' && current !== null) {
if (current === null) return null
if (typeof current !== 'undefined') {
return current[pathPart]
}
return undefined
Expand Down

0 comments on commit 50a016d

Please sign in to comment.