fix: fallback delve to undefined for an undefined key

This commit is contained in:
Christian Kaisermann 2021-09-30 10:54:24 -03:00
parent 20986aa506
commit 64e8ae2bd3

View File

@ -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];
}