Files
smartrequest/ts/core/index.ts
2025-07-28 17:01:34 +00:00

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');
}
};