fix(lib/modules/metro): move nativeModuleProxy check to specific-export check
This commit is contained in:
parent
f9c048b623
commit
52be51ac88
1 changed files with 5 additions and 5 deletions
|
|
@ -49,7 +49,10 @@ export function isModuleExportBad(exp: Metro.ModuleExports[PropertyKey]) {
|
|||
// Nullish?
|
||||
exp == null ||
|
||||
// Is it a proxy? (discord-intl has proxy exports)
|
||||
isProxy(exp)
|
||||
isProxy(exp) ||
|
||||
// Can't run isProxy() on this because this isn't your typical proxy:
|
||||
// https://github.com/discord/react-native/blob/master/packages/react-native/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleBinding.cpp
|
||||
exp === nativeModuleProxy
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -62,10 +65,7 @@ export function isModuleExportsBad(exports: Metro.ModuleExports) {
|
|||
// Nullish?
|
||||
exports == null ||
|
||||
// Checking if the object is empty
|
||||
(exports.__proto__ === Object.prototype && !Reflect.ownKeys(exports).length) ||
|
||||
// Can't run isProxy() on this because this isn't your typical proxy:
|
||||
// https://github.com/discord/react-native/blob/master/packages/react-native/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleBinding.cpp
|
||||
exports === nativeModuleProxy
|
||||
(exports.__proto__ === Object.prototype && !Reflect.ownKeys(exports).length)
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue