mirror of
https://github.com/nocobase/nocobase
synced 2024-11-16 15:37:36 +00:00
12 lines
261 B
TypeScript
12 lines
261 B
TypeScript
|
export function requireModule(module: any) {
|
||
|
if (typeof module === 'string') {
|
||
|
module = require(module);
|
||
|
}
|
||
|
if (typeof module !== 'object') {
|
||
|
return module;
|
||
|
}
|
||
|
return module.__esModule ? module.default : module;
|
||
|
}
|
||
|
|
||
|
export default requireModule;
|