2022-07-19 22:51:27 +08:00
|
|
|
export function requireModule(m: any) {
|
|
|
|
if (typeof m === 'string') {
|
|
|
|
m = require(m);
|
2022-06-20 23:29:21 +08:00
|
|
|
}
|
2022-07-19 22:51:27 +08:00
|
|
|
if (typeof m !== 'object') {
|
|
|
|
return m;
|
2022-06-20 23:29:21 +08:00
|
|
|
}
|
2022-07-19 22:51:27 +08:00
|
|
|
return m.__esModule ? m.default : m;
|
2022-06-20 23:29:21 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export default requireModule;
|