16 lines
474 B
TypeScript
16 lines
474 B
TypeScript
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');
|
|
}
|
|
};
|