mirror of
https://github.com/cupcakearmy/svelte-i18n.git
synced 2024-06-30 10:44:50 +02:00
fix: fallback delve to undefined for an undefined key
This commit is contained in:
parent
20986aa506
commit
64e8ae2bd3
|
@ -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) {
|
if (fullKey in obj) {
|
||||||
return obj[fullKey];
|
return obj[fullKey];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user