File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,7 +12,14 @@ export type LocaleProxy = Readonly<
1212 LocaleDefinition [ key ]
1313 > ;
1414 } & {
15+ /**
16+ * The raw locale definition used to create this proxy.
17+ * This can be useful to check if a category/entry exists without triggering the proxy's error.
18+ */
1519 raw : LocaleDefinition ;
20+ /**
21+ * Marker to identify a `LocaleProxy`.
22+ */
1623 [ LOCALE_PROXY_TAG ] : true ;
1724 }
1825> ;
@@ -36,7 +43,11 @@ const throwReadOnlyError: () => never = () => {
3643 */
3744function isLocaleProxy ( value : unknown ) : value is LocaleProxy {
3845 // eslint-disable-next-line @typescript-eslint/no-explicit-any
39- return ( value as any ) ?. [ LOCALE_PROXY_TAG ] === true ;
46+ return (
47+ value != null &&
48+ typeof value === 'object' &&
49+ ( value as any ) ?. [ LOCALE_PROXY_TAG ] === true
50+ ) ;
4051}
4152
4253/**
You can’t perform that action at this time.
0 commit comments