fix(lib/modules/metro/utils): detect proxies better in isModuleExportBad

This commit is contained in:
PalmDevs 2026-08-12 23:15:10 +07:00
parent 66465552bb
commit 3ac922a817
No known key found for this signature in database
GPG key ID: 6FAE8F8677ACA8BA

View file

@ -50,7 +50,11 @@ export function isModuleExportBad(
return ( return (
// Nullish? // Nullish?
exp == null || exp == null ||
// Does it have some non-existent key? (Turbo modules) // Does it have some non-existent key? (proxies)
(typeof exp === 'object' && CATCH_ALL_TEST in exp) (typeof exp === 'object' &&
// Implementing Reflect.get
(exp[CATCH_ALL_TEST] !== undefined ||
// Implementing Reflect.ownKeys
CATCH_ALL_TEST in exp))
) )
} }