@homer0/root-file
Version:
Import or require a file for the project root
2 lines • 813 B
JavaScript
var r=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,i)=>(typeof require<"u"?require:e)[i]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});import{pathUtils as l}from"@homer0/path-utils";import{providerCreator as a,injectHelper as c}from"@homer0/jimple";var s=c(),o=class{pathUtils;constructor({inject:e={}}={}){this.pathUtils=s.get(e,"pathUtils",()=>l())}require(e){return r(this.pathUtils.join(e))}import(e){return import(this.pathUtils.join(e))}},U=(...t)=>new o(...t),m=a(({serviceName:t="rootFile",...e}={})=>i=>{i.set(t,()=>{let{services:p={}}=e,n=s.resolve(["pathUtils"],i,p);return new o({inject:n})})});export{o as RootFile,U as rootFile,m as rootFileProvider};
//# sourceMappingURL=index.js.map