Comparing version 1.8.7 to 1.8.8
{ | ||
"name": "esmock", | ||
"version": "1.8.7", | ||
"version": "1.8.8", | ||
"license": "ISC", | ||
@@ -5,0 +5,0 @@ "readmeFilename": "README.md", |
@@ -34,3 +34,3 @@ ```diff | ||
"test-ts-node": "node --loader=ts-node/esm --loader=esmock --test *ts", | ||
"test-jest": "NODE_OPTIONS='--loader=esmock' jest" | ||
"test-jest": "NODE_OPTIONS=--loader=esmock jest" | ||
}, | ||
@@ -37,0 +37,0 @@ "jest": { |
@@ -1,2 +0,2 @@ | ||
import G from"process";import p from"path";import g from"url";import U from"./esmock.js";import $ from"./esmockIsLoader.js";global.esmockloader=$;export default U;const k="file:///"+p.join(p.dirname(g.fileURLToPath(import.meta.url)),"esmock.js").replace(/^\//,""),w=/\?esmockGlobals=.*/,L=/.*\?esmockGlobals=/,u=/#esmockModuleKeys/,f=/.*exportNames=(.*)/,j=/esmockKey=\d*/,A=/[^#]*#/,C=/isesm=true/,I=async(e,o,s)=>{const{parentURL:t}=o,[a]=t&&t.match(/\?esmk=\d*/)||[],n=a?global.esmockKeyGet(a.split("=")[1]):t,[i]=n&&n.match(j)||[],r=o.conditions.slice(-1)[0]==="node-addons"?o.importAssertions&&o.parentURL?await s(e,o):await s(e):o.parentURL?await s(e,o):await s(e);if(!i)return r;const h=decodeURI(r.url),l=new RegExp(".*("+h+"\\?"+i+"[^#]*).*"),[R,d]=n.split(u),c=R.replace(L,""),K=l.test(d)&&d.replace(l,"$1"),b=l.test(c)&&c.replace(l,"$1"),m=K||b;return m?r.url=C.test(m)?m:k+"#"+m:c&&c!=="null"&&(r.url.startsWith("node:")||(r.url+="?esmockGlobals="+c)),r},y=async(e,o,s)=>{if(u.test(e))return s(e,o);e=e.replace(w,""),e.startsWith(k)&&(e=e.replace(A,""));const t=f.test(e)&&e.replace(f,"$1").split(",");return t.length?{format:"module",shortCircuit:!0,responseURL:encodeURI(e),source:t.map(a=>a==="default"?`export default global.esmockCacheGet("${e}").default`:`export const ${a} = global.esmockCacheGet("${e}").${a}`).join(` | ||
`)}:s(e,o)},N=" 16. 12">G.versions.node.split(".").slice(0,2).map(e=>e.padStart(3)).join(".")&&y;export{y as load,I as resolve,N as getSource}; | ||
import g from"process";import p from"path";import U from"url";import L from"./esmock.js";import $ from"./esmockIsLoader.js";global.esmockloader=$;export default L;const k="file:///"+p.join(p.dirname(U.fileURLToPath(import.meta.url)),"esmock.js").replace(/^\//,""),u=" 16. 12">g.versions.node.split(".").slice(0,2).map(e=>e.padStart(3)).join("."),w=/\?esmockGlobals=.*/,j=/.*\?esmockGlobals=/,f=/#esmockModuleKeys/,y=/.*exportNames=(.*)/,A=/esmockKey=\d*/,C=/[^#]*#/,I=/isesm=true/,N=async(e,o,s)=>{const{parentURL:t}=o,[a]=t&&t.match(/\?esmk=\d*/)||[],n=a?global.esmockKeyGet(a.split("=")[1]):t,[i]=n&&n.match(A)||[],c=o.conditions.slice(-1)[0]==="node-addons"?o.importAssertions&&o.parentURL||u?await s(e,o):await s(e):o.parentURL?await s(e,o):await s(e);if(!i)return c;const R=decodeURI(c.url),l=new RegExp(".*("+R+"\\?"+i+"[^#]*).*"),[K,d]=n.split(f),r=K.replace(j,""),b=l.test(d)&&d.replace(l,"$1"),G=l.test(r)&&r.replace(l,"$1"),m=b||G;return m?c.url=I.test(m)?m:k+"#"+m:r&&r!=="null"&&(c.url.startsWith("node:")||(c.url+="?esmockGlobals="+r)),c},h=async(e,o,s)=>{if(f.test(e))return s(e,o);e=e.replace(w,""),e.startsWith(k)&&(e=e.replace(C,""));const t=y.test(e)&&e.replace(y,"$1").split(",");return t.length?{format:"module",shortCircuit:!0,responseURL:encodeURI(e),source:t.map(a=>a==="default"?`export default global.esmockCacheGet("${e}").default`:`export const ${a} = global.esmockCacheGet("${e}").${a}`).join(` | ||
`)}:s(e,o)},P=u&&h;export{h as load,N as resolve,P as getSource}; |
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
12062