nocobase/packages/core/utils/src/requireModule.ts
Junyi ecf82208eb
refactor(plugin-workflow): abstract to classes (#515)
* refactor(plugin-workflow): abstract to classes

* fix(plugin-workflow): add indexes and fix cases

* test(plugin-workflow): skip schedule cases
2022-06-20 23:29:21 +08:00

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;