update
This commit is contained in:
15
ts/core/index.ts
Normal file
15
ts/core/index.ts
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
import * as smartenv from '@push.rocks/smartenv';
|
||||||
|
|
||||||
|
let usedImplementation: typeof import('../core_base/index.js');
|
||||||
|
|
||||||
|
const smartenvInstance = new smartenv.Smartenv();
|
||||||
|
|
||||||
|
export const getImplementation = async () => {
|
||||||
|
if (smartenvInstance.isNode) {
|
||||||
|
usedImplementation = await smartenvInstance.getSafeNodeModule<
|
||||||
|
typeof import('../core_node/index.js')
|
||||||
|
>('../core_node/index.js');
|
||||||
|
} else {
|
||||||
|
usedImplementation = await import('../core_fetch/index.js');
|
||||||
|
}
|
||||||
|
};
|
Reference in New Issue
Block a user