Skip to content

Commit

Permalink
fix: fallback delve to undefined for an undefined key
Browse files Browse the repository at this point in the history
  • Loading branch information
kaisermann committed Sep 30, 2021
1 parent 20986aa commit 64e8ae2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/shared/delve.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
export function delve(obj: Record<string, unknown>, fullKey: string) {
export function delve(obj: Record<string, unknown>, fullKey?: string) {
if (fullKey == null) return undefined;

if (fullKey in obj) {
return obj[fullKey];
}
Expand Down

0 comments on commit 64e8ae2

Please sign in to comment.