mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 09:38:51 +00:00
fix(core): change proxied agent methods to native (#654)
This commit is contained in:
parent
a60759b2eb
commit
b215f92ecc
@ -98,7 +98,6 @@ class DatabaseVersion {
|
||||
return false;
|
||||
}
|
||||
const [result] = (await this.db.sequelize.query(dialects[dialect].sql)) as any;
|
||||
console.log(`db version: ${dialects[dialect].get(result?.[0]?.version)}`);
|
||||
return semver.satisfies(dialects[dialect].get(result?.[0]?.version), versions[dialect]);
|
||||
}
|
||||
}
|
||||
|
@ -121,9 +121,7 @@ export class MockServer extends Application {
|
||||
return proxy;
|
||||
};
|
||||
}
|
||||
return (...args: any[]) => {
|
||||
return agent[method](...args);
|
||||
};
|
||||
return agent[method];
|
||||
},
|
||||
});
|
||||
return proxy as any;
|
||||
|
@ -1,11 +1,11 @@
|
||||
export function requireModule(module: any) {
|
||||
if (typeof module === 'string') {
|
||||
module = require(module);
|
||||
export function requireModule(m: any) {
|
||||
if (typeof m === 'string') {
|
||||
m = require(m);
|
||||
}
|
||||
if (typeof module !== 'object') {
|
||||
return module;
|
||||
if (typeof m !== 'object') {
|
||||
return m;
|
||||
}
|
||||
return module.__esModule ? module.default : module;
|
||||
return m.__esModule ? m.default : m;
|
||||
}
|
||||
|
||||
export default requireModule;
|
||||
|
Loading…
Reference in New Issue
Block a user