mirror of
https://github.com/cupcakearmy/svelte-i18n.git
synced 2024-11-16 18:10:43 +01: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) {
|
||||
return obj[fullKey];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user