UNPKG

@code-hud/hud-node-sdk

Version:

Hud's Node SDK

2 lines 1.83 kB
import{createRequire as e}from"node:module";var t={180:function(e,t,r){var o=this&&this.__createBinding||(Object.create?function(e,t,r,o){void 0===o&&(o=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,o,n)}:function(e,t,r,o){void 0===o&&(o=r),e[o]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||o(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),n(r(898),t)},898:t=>{t.exports=e(import.meta.url)("../cjs/internal")}},r={},o=function e(o){var n=r[o];if(void 0!==n)return n.exports;var i=r[o]={exports:{}};return t[o].call(i.exports,i,i.exports,e),i.exports}(180);const n=e(import.meta.url)("url");let i,s;const a=(0,o.isSupportedNative)(),c=async({port:e})=>{i=e,s=(0,o.shouldSupportSourceMap)(),setTimeout((()=>{try{o.instrument_logger.info("Getting tsconfig from esm loader"),(0,o.getUserTsNodeConfig)(!1)}catch(e){o.instrument_logger.error("Error getting tsconfig from esm loader",{msg:e instanceof Error?e.message:void 0,stack:e instanceof Error?e.stack:void 0})}}),o.hudConfig.tsNodeConfigTimeout)},u=async(e,t,r)=>{const c=await r(e,t);if(!a)return c;try{if(c.format===o.Format.esm&&c.source){const t=(0,n.fileURLToPath)(e);o.instrument_logger.debug("Loading module",{modulePath:t});const r=(0,o.patch)(c.source?.toString(),t,o.Format.esm,i);if(c.source=r.code,s&&r.map){const e=(0,o.combineSourceMaps)(r.map,t);e&&i.postMessage({key:"HudRetrieveFileCache",filename:t,content:e})}}}catch(e){o.instrument_logger.error("Something went wrong in load hook",{msg:e instanceof Error?e.message:void 0,stack:e instanceof Error?e.stack:void 0})}return c};export{c as initialize,u as load}; //# sourceMappingURL=loader.mjs.map