Comparing version 2.6.1 to 2.6.2
{ | ||
"name": "esmock", | ||
"type": "module", | ||
"version": "2.6.1", | ||
"version": "2.6.2", | ||
"license": "ISC", | ||
@@ -6,0 +6,0 @@ "readmeFilename": "README.md", |
var Xe=Object.defineProperty;var Ye=(e,t)=>{for(var s in t)Xe(e,s,{get:t[s],enumerable:!0})};import Qe from"node:module";var v={};Ye(v,{default:()=>C,getSource:()=>jt,globalPreload:()=>kt,initialize:()=>yt,load:()=>le,resolve:()=>bt});import rt from"node:fs/promises";import re from"node:module";import nt from"process";var et=(e,t)=>new Error(`invalid moduleId: "${e}" (used by ${t})`),tt=(e,t)=>new Error(`un-mocked moduleId: "${e}" (used by ${t})`),st=()=>new Error("For versions of node prior to v20.6.0, the loader chain process must include esmock. start the process using --loader=esmock."),ot=(e,t)=>new Error(`no mocks provided for module: "${e}" (used by ${t})`),f={errModuleIdNotFound:et,errModuleIdNotMocked:tt,errMissingLoader:st,errModuleIdNoDefs:ot};var[Q,ct]=nt.versions.node.split(".").map(e=>+e),ne=Q<16||Q===16&&ct<12,g=import.meta.url,it=/\?esmkgdefs=.*/,ce=/.*\?esmkgdefs=/,O=/#-#esmkdefs/,X=/^file:\/\/\/import\?/,at=/file:\/\/\/import\?([^#]*)/,lt=/\bimport,|,import\b|\bimport\b/g,x=/esmkTreeId=\d*/,mt=/esmkModuleId=([^&]*)/,Y=/\?esmk=\d*/,I=/.*exportNames=(.*)/,pt=/.*#-#/,ut=/isesm=true/,dt=/isfound=false/,ft=/^(commonjs|module)$/,gt=/strict=3/,ee=/^(#![^\n]*\n)/,te=(e,t)=>new RegExp(`.*(${e}(\\?${t}(?:(?!#-#).)*)).*`),E=global.mockKeys=global.mockKeys||{},S=global.mockKeysSource=global.mockKeysSource||{},kt=!re.register&&(({port:e})=>(e.addEventListener("message",t=>t.data.keysource?S[t.data.keysource]=t.data.source:E[t.data.key]=t.data.keylong),e.unref(),"global.postMessageEsmk = d => port.postMessage(d)")),yt=re.register&&(e=>{e&&e.port&&e.port.on("message",t=>{t.keysource?S[t.keysource]=t.source:E[t.key]=t.keylong})}),se=e=>{let[t,s]=e.match(at)||[];return[t,I.test(s)&&s.replace(I,"$1").split(",")]},ht=e=>{let t=e.split(O)[1]||"",s=se(t),o=e.replace(ce,""),r=se(o);return[s[0]||r[0],[...new Set([s[1]||[],r[1]||[]].flat())]]},ie=e=>Y.test(e)&&E[e.match(Y)[0].split("=")[1]],oe=async(e,t,s)=>s.parentURL&&(s.conditions.slice(-1)[0]==="node-addons"||s.importAssertions||ne)?e(t,s):e(t),bt=async(e,t,s)=>{let{parentURL:o}=t,r=ie(o)||o;if(!x.test(r))return oe(s,e,t);let[n]=String(r).match(x),[c,l]=r.split(O),a=c&&c.replace(ce,"");if(r.includes(`esmkModuleId=${e}&isfound=false`)){let b=te(`file:///${e}`,n),j=(a.match(b)||l.match(b)||[])[2];if(j)return{shortCircuit:!0,url:g+j}}if(X.test(e))return{shortCircuit:!0,url:e.replace(X,g+"?")};let m=await oe(s,e,t),u=te(m.url,n),d=u.test(l)&&l.replace(u,"$1")||u.test(a)&&a.replace(u,"$1");if(d?m.url=ut.test(d)?d:g+"#-#"+d:a&&a!=="0"&&(m.url.startsWith("node:")||(m.url+="?esmkgdefs="+a)),gt.test(r)&&!d)throw f.errModuleIdNotMocked(m.url,r.split("?")[0]);return m},ae=g+"?esmock-loader=true",C=(e=>async()=>e=e||(await import(ae)).default===!0)(),le=async(e,t,s)=>{if(e===ae)return{format:"module",shortCircuit:!0,responseURL:e,source:"export default true"};let o=ie(e)||e,r=o&&(o.match(x)||[])[0];if(r){let[c,l]=ht(o);if(l&&l.length){let a=await s(e,t);if(!ft.test(a.format))return a;let m=a.source===null||a.source===void 0,u=String(m?await rt.readFile(new URL(e)):a.source),d=(u.match(ee)||[])[0]||"",b=d?u.replace(ee,""):u,j=a.format==="commonjs"?`const {${l}} = global.esmockCacheGet("${c}");`:`import {${l}} from '${c}';`;return{format:a.format,shortCircuit:!0,responseURL:encodeURI(e),source:d+j+b}}}if(O.test(e))return s(e,t);e=e.replace(it,""),e.startsWith(g)&&(e=e.replace(pt,""),dt.test(e)&&(e=e.replace(g,`file:///${e.match(mt)[1]}`)));let n=I.test(e)&&e.replace(I,"$1").replace(lt,"").split(",");return n&&n[0]?S[e]?{format:"json",shortCircuit:!0,responseURL:encodeURI(e),source:S[e]}:{format:"module",shortCircuit:!0,responseURL:encodeURI(e),source:n.map(c=>c==="default"?`export default global.esmockCacheGet("${e}").default`:`export const ${c} = global.esmockCacheGet("${e}").${c}`).join(` | ||
`)}:(r&&!e.includes(r)&&(e=e+"?esmk="+r.split("=")[1]),s(e,t))},jt=ne&≤import We from"fs";import Ht from"url";import ge from"fs";import ke from"url";import i from"path";import ye from"module";var he=ye.createRequire(import.meta.url),me=ge.realpathSync.native,be=new RegExp("^(?:node:)?("+ye.builtinModules.join("|").replace("/","/")+")$"),je=/^\.?\.?([a-zA-Z]:)?(\/|\\)/,G=/^.\.?(?=\/|\\)/,pe=/\\/g,It=/index.[tj]sx?$/,St=/[\\/]resolvewithplus[\\/]/,ue=/\.js$/,Mt=/\.ts$/,wt=/(^@[^/]*\/[^/]*|^[^/]*)\/?(.*)$/,F=/^#/,Ie=/(\*)/g,Se=/([./])/g,$t=/^node:/,Rt=/^file:/,Me=[".js",".mjs",".ts",".tsx",".json",".node"],xt=Me.map(e=>`index${e}`),de="node_modules",w="package.json",we="node",M="default",Ot="browser",$e="import",P=":spectype",Re="module",xe="import",Oe="commonjs",Et="require",K=".",Ct=e=>e&&typeof e=="object",A={},T=e=>({[Re]:xe,[Oe]:Et})[e]||null,vt=e=>$t.test(e)?e:`node:${e}`,Kt=e=>e&&ke.pathToFileURL(e).href,Nt=e=>be.test(e),Ft=e=>Rt.test(e)?ke.fileURLToPath(e):e,Pt=e=>i.resolve(i.extname(e)?i.dirname(e):e)+i.sep,D=e=>pe.test(e)?e.replace(pe,i.posix.sep):e,k=(e,t)=>{try{t=ge.statSync(e)}catch{t=!1}return t&&(t.isFile()||t.isFIFO())},Ee=(e,t)=>t.packagejsonmap&&t.packagejsonmap[e]||k(e)&&he(e),At=(e,t)=>{let s=t.find(o=>k(e+o))||null;return s&&e+s},Tt=(e,t)=>{let s=t.find(o=>k(i.join(e,o)))||null;return s&&i.join(e,s)},Ce=(e,t=e.split(i.sep))=>{let s=(o,r=[[],[]])=>{if(!o.length)return r[1];if(o[0]===de&&St.test(e))return s(o.slice(1),r);let n=r[0].length?i.join(r[0].slice(-1)[0],o[0]):o[0]||i.sep;return r[0].push(n),r[1].push(i.resolve(i.join(n,de))),s(o.slice(1),r)};return s(t)},Dt=e=>{let t=e.split(i.sep).slice(1).reduce((s,o,r)=>(s.push(i.resolve(i.join(r?s[r-1]:i.sep,o))),s),[]).reverse().find(s=>k(i.join(s,w)));return t&&i.join(t,w)},Gt=e=>(String(e).match(wt)||[]).slice(1),fe=(e,t)=>new RegExp(e.replace(Se,"\\$1").replace(Ie,".*")).test(t),zt=(e,t,s)=>{let o=new RegExp(e.replace(Se,"\\$1").replace(Ie,"(.*)")),r=(s.match(o)||[])[1];return r&&t.replace("*",r)},ve=(e,t,s,o=!1)=>(fe(e,s)&&(t.includes("*")?fe(t,s)?o=s:e.includes("*")&&e!==t&&(o=zt(e,t,s)):o=t),o),Ke=(e,t,s,o=e[0])=>e.length?(F.test(s)?F.test(o):G.test(o))&&typeof t[o]=="string"&&ve(o,t[o],s)||Ke(e.slice(1),t,s):null,p=(e,t,s={})=>{let o=s.priority||[we,M],r=!1;return typeof e=="string"?e:(!r&&Array.isArray(e)&&(r=e.reduce((n,c)=>n||p(c,t,s),null)),!r&&Ct(e)&&(typeof e[t]=="string"&&(r=e[t]),r||(r=o.reduce((n,c)=>n||(c=c===P?T(s.packagejsontype):c,p(e[c],t,s)),!1)),!r&&e[M]&&(r=p(e[M],t)),!r&&e[t]&&(r=p(e[t],t,s)),r||(r=Ke(Object.keys(e),e,t)),!r&&e[K]&&(o.includes(t)?r=o.reduce((n,c)=>n||(c=c===P?T(s.packagejsontype):c,p(e[K],c,s)),!1):r=p(e[K],t,s))),r)},$=(e,t={})=>{var s=null,o=t.istypescript&&ue.test(e)&&e.replace(ue,".ts");return k(o)?s=o:k(e)?s=e:s=At(e,Me),s},z=e=>e.type||"exports"in e&&Re||Oe,N=(e,t={},s="")=>{let o=s?i.join(s,e):e;return $(o,t)||!It.test(e)&&$(i.join(o,"index"))},Ut=(e,t={},s="",o=!1)=>{let r=z(e);return t.isspectype!==!1&&(o=e[r]||e[T(r)],o=o&&N(o,t,s)),!o&&(t.priority||[]).includes(xe)&&e.module&&(o=N(e.module,t,s)),!o&&e.main&&(o=N(e.main,t,s)),o||null},Ne=(e,t={},s="",o)=>{let r=z(e),n=Object.assign({packagejsontype:r},t);return t.isbrowser&&e.browser&&(o=p(e.browser,$e,n),o=o&&!je.test(o)?i.join(s,o):o),o||(o=Ut(e,n,s)),o},Fe=(e,t)=>{let s=i.join(e,w),o=Ee(s,t);return(o?Ne(o,t,e):!1)||Tt(e,xt)},Pe=(e,t,s)=>{let o=G.test(e)?i.join(t,e):e;return $(o,s)||Fe(o,s)},Bt=(e,t,s,o)=>{let r=s&&s.imports,n=p(r,t,o);return n&&(G.test(n)?i.join(e,n):Te(n,e,{isposixpath:!0}))},_t=(e,t,s,o,r)=>{let n=p(o&&o.exports,s?"./"+s:$e,r);return n&&i.join(e,t,n)},qt=(e,t,s,o)=>{let r=i.join(e,t,w),n=Ee(r,o),c=n&&z(n);return n&&_t(e,t,s,n,Object.assign({packagejsontype:c},o))},Jt=(e,t,s)=>{let o=Dt(t),r=i.dirname(o);return o&&Bt(r,e,he(o),s)},Wt=(e,t,s)=>{let[o,r]=Gt(e);if(F.test(o))return Jt(e,t,s);let n=Ce(t);return function c(l,a){return a--?qt(i.join(l[a]),o,r,s)||Pe(i.join(l[a],e),null,s)||c(n,a):null}(n,n.length)},Vt=(e,t,s)=>{var o=null;return t=typeof t=="string"?Pt(Ft(decodeURI(t))):process.cwd(),be.test(e)?o=vt(e):(o=je.test(e)?Pe(D(e),t,s):Wt(e,t,s),o=o&&(s.isposixpath?me(o):Kt(D(me(o))))),o},Ae=(e,t,s)=>{let o=(r,n)=>typeof r=="boolean"?r:n;return s=s||{},s.istypescript=o(s.istypescript,Mt.test(t)),s.isbrowser=o(s.isbrowser,!1),s.isspectype=o(s.isspectype,!0),s.packagejsonmap=s.packagejsonmap||null,Array.isArray(s.priority)||(s.priority=s.isbrowser?[Ot]:[],s.priority.push(P),s.priority.push(we),s.priority.push(M)),s},Te=(e,t,s)=>{let o=A[e+t];return o||(s=Ae(e,t,s),o=Vt(e,t,s),A[e+t]=o)},R=Object.assign(Te,{pathToPosix:D,getasnode_module_paths:Ce,getesmkeyvalmatch:ve,getasfilesync:$,getasdirsync:Fe,gettargetindex:Ne,iscoremodule:Nt,createopts:Ae,esmparse:p,cache:A});var De=/(^\s*|[});\n]\s*)(import\s+(['"]|(\*\s+as\s+)?[^"'()\n;]+\s+from\s+['"]|\{)|export\s+\*\s+from\s+["']|export\s+(\{|default|function|class|var|const|let|async\s+function))/;import Ge from"node:module";import ze from"node:worker_threads";var U=ze.MessageChannel&&new ze.MessageChannel,Ue=(e=>()=>(typeof e=="boolean"||(e=!!Ge.register)&&Ge.register("./esmockLoader.js",{parentURL:import.meta.url,data:{port:U.port2},transferList:[U.port2]}),e))(),B=Object.assign(e=>{Ue()?U.port1.postMessage(e):typeof global.postMessageEsmk=="function"&&global.postMessageEsmk(e)},{register:Ue});var _={isESM:{},mockDefs:{}},Be=(e,t)=>(B({keysource:e,source:t}),global.mockKeysSource[String(e)]=t);var _e=(e,t)=>(B({key:e,keylong:t}),global.mockKeys[String(e)]=t),q=e=>global.mockKeys[String(e)],J=(e,t)=>global.esmockCache.mockDefs[e]=t,Zt=e=>global.esmockCache.mockDefs[e],qe=e=>_.isESM[e],Je=(e,t)=>_.isESM[e]=t;Object.assign(global,{esmockCache:_,esmockCacheGet:Zt,esmockTreeIdGet:q,mockKeys:global.mockKeys||{},mockKeysSource:global.mockKeysSource||{}});var W=e=>typeof e=="object"&&e,V=e=>W(e)&&"default"in e,Lt=/^\.?\.?([a-zA-Z]:)?(\/|\\)/,Qt=((e=0)=>()=>++e)(),Xt=Object.getPrototypeOf({}),Yt=e=>Object.getPrototypeOf(e)===Xt,Ve=R.iscoremodule,H=/\.json$/i,es=(e,t)=>Yt(e)?Object.assign({},e,t):Object.assign(Object.keys(e).reduce((s,o)=>(Object.defineProperty(s,o,{value:e[o],writable:!0}),s),Object.create(e)),t),ts=(e,t)=>W(e)&&W(t)?es(e,t):t,ss=(e,t,s)=>s===null||H.test(s)?Object.assign({},e||{},t):Array.isArray(t)?{default:t.slice()}:(t=Object.assign({},e||{},{default:ts(V(e)&&e.default,V(t)?t.default:t)},t),!Ve(s)&&Object.isExtensible(t.default)&&(t.default.default=t.default),t),os=(e,t)=>(t=qe(e),typeof t=="boolean"||(t=!Ve(e)&&Lt.test(e)&&De.test(We.readFileSync(e,"utf-8")),Je(e,t)),t),rs=(e,t)=>{let s=V(e)&&e.default;return/boolean|string|number/.test(typeof s)?e:Object.isExtensible(s)?Object.assign(s,e,{esmkTreeId:t}):Object.assign({},s,e,{esmkTreeId:t})},ns=e=>{let t=n=>n==="null"||J(n,null),s=q(e.split("esmk=")[1]),[o,r]=s.split("#-#esmkdefs=");String(r).split("#-#").forEach(t),String(o.split("esmkgdefs=")[1]).split("#-#").forEach(t)},cs=async e=>H.test(e)?JSON.parse(We.readFileSync(new Ht.URL(e),"utf-8")):import(e),is=async(e,t,s,o,r)=>{t=ss(r.strict||!o||await cs(o),t,o);let n=(o||"file:///"+s)+"?"+["esmkTreeId="+e,"esmkModuleId="+s,"isfound="+!!o,"isesm="+os(o),"exportNames="+Object.keys(t).sort().join()].join("&");return H.test(o)&&Be(n,JSON.stringify(t)),J(n,t),n},Z=async(e,t,s,o,r,n,c)=>{if(o=o||Object.keys(s),c=o[0],n=n||[],!c)return n;let l=r.resolver(c,e);if(!l&&r.isModuleNotFoundError!==!1&&c!=="import")throw f.errModuleIdNotFound(c,e);return n.push(await is(t,s[c],c,l,r)),Z(e,t,s,o.slice(1),r,n)},as=async(e,t,s,o,r)=>{let n=r.resolver(e,t);if(!n)throw f.errModuleIdNotFound(e,t);let c=o?Object.keys(o):[],l=s?Object.keys(s):[];if(r.strict===3&&!c.length&&!l.length)throw f.errModuleIdNoDefs(e,t);let a=typeof r.id=="number"?r.id:Qt(),m=`${n}?key=${a}&strict=${r.strict}?`+["esmkgdefs="+(c.length&&(await Z(t,a,o,c,r)).join("#-#")||0),"esmkdefs=",l.length&&(await Z(t,a,s,l,r)).join("#-#")||0].join("#-#");return _e(String(a),m),n+`?esmk=${a}`},h=Object.assign(as,{purge:ns,sanitize:rs});import{isBuiltin as ls}from"node:module";import{pathToFileURL as ms}from"node:url";var Ze=process.versions.pnp&&(await import("pnpapi")).default,He=Ze&&((e,t)=>{if(ls(e))return e.startsWith("node:")?e:`node:${e}`;if(e==="import")return null;let s=null;try{s=Ze.resolveRequest(e,t)}catch{}return s!==null?ms(s).href:null});var ps=/^.*(\(|at )(.*):[\d]*:[\d]*.*$/,us=He||R,Le=(e,t)=>(e=typeof e[1]=="string"?e:[e[0],new Error().stack.split(` | ||
`)[3].replace(ps,"$2"),...e.slice(1)],e[4]={resolver:us,...e[4],...t},e);var y=e=>async(...t)=>{let[s,o,r,n,c]=Le(t,e);if(!Qe.register&&!await C())throw f.errMissingLoader();let l=await h(s,o,r,n,c),a=await import(l);return c.purge!==!1&&h.purge(l),h.sanitize(a,l)},L=e=>e&&/object|function/.test(typeof e)&&"esmkTreeId"in e&&h.purge(e.esmkTreeId),ds=Object.assign(y({strict:1}),{purge:L,p:y({strict:1,purge:!1})}),fs=Object.assign(y({strict:3}),{purge:L,p:y({strict:3,purge:!1})}),Qs=Object.assign(y(),{purge:L,p:y({purge:!1}),strict:ds,strictest:fs});var gs=Qe.register?{}:v,{load:Xs,resolve:Ys,getSource:eo,initialize:to,globalPreload:so}=gs;export{Qs as default,eo as getSource,so as globalPreload,to as initialize,Xs as load,Ys as resolve,ds as strict,fs as strictest}; | ||
`)}:(r&&!e.includes(r)&&(e=e+"?esmk="+r.split("=")[1]),s(e,t))},jt=ne&≤import Je from"fs";import Ht from"url";import ge from"fs";import ke from"url";import i from"path";import ye from"module";var he=ye.createRequire(import.meta.url),me=ge.realpathSync.native,be=new RegExp("^(?:node:)?("+ye.builtinModules.join("|").replace("/","/")+")$"),je=/^\.?\.?([a-zA-Z]:)?(\/|\\)/,G=/^.\.?(?=\/|\\)/,pe=/\\/g,It=/index.[tj]sx?$/,St=/[\\/]resolvewithplus[\\/]/,ue=/\.js$/,Mt=/\.ts$/,wt=/(^@[^/]*\/[^/]*|^[^/]*)\/?(.*)$/,N=/^#/,Ie=/(\*)/g,Se=/([./])/g,$t=/^node:/,Rt=/^file:/,Me=[".js",".mjs",".ts",".tsx",".json",".node"],xt=Me.map(e=>`index${e}`),de="node_modules",w="package.json",we="node",M="default",Ot="browser",$e="import",P=":spectype",Re="module",xe="import",Oe="commonjs",Et="require",K=".",Ct=e=>e&&typeof e=="object",A={},T=e=>({[Re]:xe,[Oe]:Et})[e]||null,vt=e=>$t.test(e)?e:`node:${e}`,Kt=e=>e&&ke.pathToFileURL(e).href,Ft=e=>be.test(e),Nt=e=>Rt.test(e)?ke.fileURLToPath(e):e,Pt=e=>i.resolve(i.extname(e)?i.dirname(e):e)+i.sep,D=e=>pe.test(e)?e.replace(pe,i.posix.sep):e,k=(e,t)=>{try{t=ge.statSync(e)}catch{t=!1}return t&&(t.isFile()||t.isFIFO())},Ee=(e,t)=>t.packagejsonmap&&t.packagejsonmap[e]||k(e)&&he(e),At=(e,t)=>{let s=t.find(o=>k(e+o))||null;return s&&e+s},Tt=(e,t)=>{let s=t.find(o=>k(i.join(e,o)))||null;return s&&i.join(e,s)},Ce=(e,t=e.split(i.sep))=>{let s=(o,r=[[],[]])=>{if(!o.length)return r[1];if(o[0]===de&&St.test(e))return s(o.slice(1),r);let n=r[0].length?i.join(r[0].slice(-1)[0],o[0]):o[0]||i.sep;return r[0].push(n),r[1].push(i.resolve(i.join(n,de))),s(o.slice(1),r)};return s(t)},Dt=e=>{let t=e.split(i.sep).slice(1).reduce((s,o,r)=>(s.push(i.resolve(i.join(r?s[r-1]:i.sep,o))),s),[]).reverse().find(s=>k(i.join(s,w)));return t&&i.join(t,w)},Gt=e=>(String(e).match(wt)||[]).slice(1),fe=(e,t)=>new RegExp(e.replace(Se,"\\$1").replace(Ie,".*")).test(t),zt=(e,t,s)=>{let o=new RegExp(e.replace(Se,"\\$1").replace(Ie,"(.*)")),r=(s.match(o)||[])[1];return r&&t.replace("*",r)},ve=(e,t,s,o=!1)=>(fe(e,s)&&(t.includes("*")?fe(t,s)?o=s:e.includes("*")&&e!==t&&(o=zt(e,t,s)):o=t),o),Ke=(e,t,s,o=e[0])=>e.length?(N.test(s)?N.test(o):G.test(o))&&typeof t[o]=="string"&&ve(o,t[o],s)||Ke(e.slice(1),t,s):null,p=(e,t,s={})=>{let o=s.priority||[we,M],r=!1;return typeof e=="string"?e:(!r&&Array.isArray(e)&&(r=e.reduce((n,c)=>n||p(c,t,s),null)),!r&&Ct(e)&&(typeof e[t]=="string"&&(r=e[t]),r||(r=o.reduce((n,c)=>n||(c=c===P?T(s.packagejsontype):c,p(e[c],t,s)),!1)),!r&&e[M]&&(r=p(e[M],t)),!r&&e[t]&&(r=p(e[t],t,s)),r||(r=Ke(Object.keys(e),e,t)),!r&&e[K]&&(o.includes(t)?r=o.reduce((n,c)=>n||(c=c===P?T(s.packagejsontype):c,p(e[K],c,s)),!1):r=p(e[K],t,s))),r)},$=(e,t={})=>{var s=null,o=t.istypescript&&ue.test(e)&&e.replace(ue,".ts");return k(o)?s=o:k(e)?s=e:s=At(e,Me),s},z=e=>e.type||"exports"in e&&Re||Oe,F=(e,t={},s="")=>{let o=s?i.join(s,e):e;return $(o,t)||!It.test(e)&&$(i.join(o,"index"))},Ut=(e,t={},s="",o=!1)=>{let r=z(e);return t.isspectype!==!1&&(o=e[r]||e[T(r)],o=o&&F(o,t,s)),!o&&(t.priority||[]).includes(xe)&&e.module&&(o=F(e.module,t,s)),!o&&e.main&&(o=F(e.main,t,s)),o||null},Fe=(e,t={},s="",o)=>{let r=z(e),n=Object.assign({packagejsontype:r},t);return t.isbrowser&&e.browser&&(o=p(e.browser,$e,n),o=o&&!je.test(o)?i.join(s,o):o),o||(o=Ut(e,n,s)),o},Ne=(e,t)=>{let s=i.join(e,w),o=Ee(s,t);return(o?Fe(o,t,e):!1)||Tt(e,xt)},Pe=(e,t,s)=>{let o=G.test(e)?i.join(t,e):e;return $(o,s)||Ne(o,s)},Wt=(e,t,s,o)=>{let r=s&&s.imports,n=p(r,t,o);return n&&(G.test(n)?i.join(e,n):Te(n,e,{isposixpath:!0}))},Bt=(e,t,s,o,r)=>{let n=p(o&&o.exports,s?"./"+s:$e,r);return n&&i.join(e,t,n)},_t=(e,t,s,o)=>{let r=i.join(e,t,w),n=Ee(r,o),c=n&&z(n);return n&&Bt(e,t,s,n,Object.assign({packagejsontype:c},o))},qt=(e,t,s)=>{let o=Dt(t),r=i.dirname(o);return o&&Wt(r,e,he(o),s)},Jt=(e,t,s)=>{let[o,r]=Gt(e);if(N.test(o))return qt(e,t,s);let n=Ce(t);return function c(l,a){return a--?_t(i.join(l[a]),o,r,s)||Pe(i.join(l[a],e),null,s)||c(n,a):null}(n,n.length)},Vt=(e,t,s)=>{var o=null;return t=typeof t=="string"?Pt(Nt(decodeURI(t))):process.cwd(),be.test(e)?o=vt(e):(o=je.test(e)?Pe(D(e),t,s):Jt(e,t,s),o=o&&(s.isposixpath?me(o):Kt(D(me(o))))),o},Ae=(e,t,s)=>{let o=(r,n)=>typeof r=="boolean"?r:n;return s=s||{},s.istypescript=o(s.istypescript,Mt.test(t)),s.isbrowser=o(s.isbrowser,!1),s.isspectype=o(s.isspectype,!0),s.packagejsonmap=s.packagejsonmap||null,Array.isArray(s.priority)||(s.priority=s.isbrowser?[Ot]:[],s.priority.push(P),s.priority.push(we),s.priority.push(M)),s},Te=(e,t,s)=>{let o=A[e+t];return o||(s=Ae(e,t,s),o=Vt(e,t,s),A[e+t]=o)},R=Object.assign(Te,{pathToPosix:D,getasnode_module_paths:Ce,getesmkeyvalmatch:ve,getasfilesync:$,getasdirsync:Ne,gettargetindex:Fe,iscoremodule:Ft,createopts:Ae,esmparse:p,cache:A});var De=/(^\s*|[});\n]\s*)(import\s+(['"]|(\*\s+as\s+)?[^"'()\n;]+\s+from\s+['"]|\{)|export\s+\*\s+from\s+["']|export\s+(\{|default|function|class|var|const|let|async\s+function))/;import Ge from"node:module";import ze from"node:worker_threads";var U=ze.MessageChannel&&new ze.MessageChannel,Ue=(e=>()=>(typeof e=="boolean"||(e=!!Ge.register)&&Ge.register("./esmockLoader.js",{parentURL:import.meta.url,data:{port:U.port2},transferList:[U.port2]}),e))(),W=Object.assign(e=>{Ue()?U.port1.postMessage(e):typeof global.postMessageEsmk=="function"&&global.postMessageEsmk(e)},{register:Ue});var B={isESM:{},mockDefs:{}},We=(e,t)=>(W({keysource:e,source:t}),global.mockKeysSource[String(e)]=t);var Be=(e,t)=>(W({key:e,keylong:t}),global.mockKeys[String(e)]=t),_=e=>global.mockKeys[String(e)],q=(e,t)=>global.esmockCache.mockDefs[e]=t,Zt=e=>global.esmockCache.mockDefs[e],_e=e=>B.isESM[e],qe=(e,t)=>B.isESM[e]=t;Object.assign(global,{esmockCache:B,esmockCacheGet:Zt,esmockTreeIdGet:_,mockKeys:global.mockKeys||{},mockKeysSource:global.mockKeysSource||{}});var J=e=>typeof e=="object"&&e,V=e=>J(e)&&"default"in e,Lt=/^\.?\.?([a-zA-Z]:)?(\/|\\)/,Qt=((e=0)=>()=>++e)(),Xt=Object.getPrototypeOf({}),Yt=e=>Object.getPrototypeOf(e)===Xt,Ve=R.iscoremodule,H=/\.json$/i,es=/(^|,)static($|,)/g,ts=(e,t)=>Yt(e)?Object.assign({},e,t):Object.assign(Object.keys(e).reduce((s,o)=>(Object.defineProperty(s,o,{value:e[o],writable:!0}),s),Object.create(e)),t),ss=(e,t)=>J(e)&&J(t)?ts(e,t):t,os=(e,t,s)=>s===null||H.test(s)?Object.assign({},e||{},t):Array.isArray(t)?{default:t.slice()}:(t=Object.assign({},e||{},{default:ss(V(e)&&e.default,V(t)?t.default:t)},t),!Ve(s)&&Object.isExtensible(t.default)&&(t.default.default=t.default),t),rs=(e,t)=>(t=_e(e),typeof t=="boolean"||(t=!Ve(e)&&Lt.test(e)&&De.test(Je.readFileSync(e,"utf-8")),qe(e,t)),t),ns=(e,t)=>{let s=V(e)&&e.default;return/boolean|string|number/.test(typeof s)?e:Object.isExtensible(s)?Object.assign(s,e,{esmkTreeId:t}):Object.assign({},s,e,{esmkTreeId:t})},cs=e=>{let t=n=>n==="null"||q(n,null),s=_(e.split("esmk=")[1]),[o,r]=s.split("#-#esmkdefs=");String(r).split("#-#").forEach(t),String(o.split("esmkgdefs=")[1]).split("#-#").forEach(t)},is=async e=>H.test(e)?JSON.parse(Je.readFileSync(new Ht.URL(e),"utf-8")):import(e),as=async(e,t,s,o,r)=>{t=os(r.strict||!o||await is(o),t,o);let n=(o||"file:///"+s)+"?"+["esmkTreeId="+e,"esmkModuleId="+s,"isfound="+!!o,"isesm="+rs(o),"exportNames="+Object.keys(t).sort().join().replace(es,c=>c.startsWith(",")&&c.endsWith(",")?",":"")].join("&");return H.test(o)&&We(n,JSON.stringify(t)),q(n,t),n},Z=async(e,t,s,o,r,n,c)=>{if(o=o||Object.keys(s),c=o[0],n=n||[],!c)return n;let l=r.resolver(c,e);if(!l&&r.isModuleNotFoundError!==!1&&c!=="import")throw f.errModuleIdNotFound(c,e);return n.push(await as(t,s[c],c,l,r)),Z(e,t,s,o.slice(1),r,n)},ls=async(e,t,s,o,r)=>{let n=r.resolver(e,t);if(!n)throw f.errModuleIdNotFound(e,t);let c=o?Object.keys(o):[],l=s?Object.keys(s):[];if(r.strict===3&&!c.length&&!l.length)throw f.errModuleIdNoDefs(e,t);let a=typeof r.id=="number"?r.id:Qt(),m=`${n}?key=${a}&strict=${r.strict}?`+["esmkgdefs="+(c.length&&(await Z(t,a,o,c,r)).join("#-#")||0),"esmkdefs=",l.length&&(await Z(t,a,s,l,r)).join("#-#")||0].join("#-#");return Be(String(a),m),n+`?esmk=${a}`},h=Object.assign(ls,{purge:cs,sanitize:ns});import{isBuiltin as ms}from"node:module";import{pathToFileURL as ps}from"node:url";var Ze=process.versions.pnp&&(await import("pnpapi")).default,He=Ze&&((e,t)=>{if(ms(e))return e.startsWith("node:")?e:`node:${e}`;if(e==="import")return null;let s=null;try{s=Ze.resolveRequest(e,t)}catch{}return s!==null?ps(s).href:null});var us=/^.*(\(|at )(.*):[\d]*:[\d]*.*$/,ds=He||R,Le=(e,t)=>(e=typeof e[1]=="string"?e:[e[0],new Error().stack.split(` | ||
`)[3].replace(us,"$2"),...e.slice(1)],e[4]={resolver:ds,...e[4],...t},e);var y=e=>async(...t)=>{let[s,o,r,n,c]=Le(t,e);if(!Qe.register&&!await C())throw f.errMissingLoader();let l=await h(s,o,r,n,c),a=await import(l);return c.purge!==!1&&h.purge(l),h.sanitize(a,l)},L=e=>e&&/object|function/.test(typeof e)&&"esmkTreeId"in e&&h.purge(e.esmkTreeId),fs=Object.assign(y({strict:1}),{purge:L,p:y({strict:1,purge:!1})}),gs=Object.assign(y({strict:3}),{purge:L,p:y({strict:3,purge:!1})}),Xs=Object.assign(y(),{purge:L,p:y({purge:!1}),strict:fs,strictest:gs});var ks=Qe.register?{}:v,{load:Ys,resolve:eo,getSource:to,initialize:so,globalPreload:oo}=ks;export{Xs as default,to as getSource,oo as globalPreload,so as initialize,Ys as load,eo as resolve,fs as strict,gs as strictest}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25690