resolvewithplus
Advanced tools
Comparing version 2.1.1 to 2.1.2
{ | ||
"name": "resolvewithplus", | ||
"version": "2.1.1", | ||
"version": "2.1.2", | ||
"description": "resolvewith with extra power", | ||
@@ -5,0 +5,0 @@ "readmeFilename": "README.md", |
@@ -1,1 +0,1 @@ | ||
import S from"fs";import _ from"url";import i from"path";import $ from"module";const y=$.createRequire(import.meta.url),E=S.realpathSync.native,P=new RegExp("^(?:node:)?("+$.builtinModules.join("|").replace("/","/")+")$"),X=/^\.?\.?([a-zA-Z]:)?(\/|\\)/,d=/^.\.?(?=\/|\\)/,F=/\\/g,Y=/index.[tj]sx?$/,k=/[\\/]resolvewithplus[\\/]/,O=/\.js$/,I=/\.ts$/,tt=/(^@[^/]*\/[^/]*|^[^/]*)\/?(.*)$/,g=/^#/,A=/(\*)/g,q=/([./])/g,et=/^node:/,st=/^file:/,T=[".js",".mjs",".ts",".tsx",".json",".node"],nt=T.map(t=>`index${t}`),U="node_modules",p="package.json",L="node",m="default",ot="browser",N="import",j=":spectype",K="module",M="import",V="commonjs",rt="require",R=".",it=t=>t&&typeof t=="object",b={},x=t=>({[K]:M,[V]:rt})[t]||null,ct=t=>et.test(t)?t:`node:${t}`,lt=t=>t&&_.pathToFileURL(t).href,ut=t=>P.test(t),at=t=>st.test(t)?_.fileURLToPath(t):t,ft=t=>i.resolve(i.extname(t)?i.dirname(t):t)+i.sep,w=t=>F.test(t)?t.replace(F,i.posix.sep):t,u=(t,n)=>{try{n=S.statSync(t)}catch{n=!1}return n&&(n.isFile()||n.isFIFO())},pt=(t,n)=>{const e=n.find(s=>u(t+s))||null;return e&&t+e},mt=(t,n)=>{const e=n.find(s=>u(i.join(t,s)))||null;return e&&i.join(t,e)},W=(t,n=t.split(i.sep))=>{const e=(s,o=[[],[]])=>{if(!s.length)return o[1];if(s[0]===U&&k.test(t))return e(s.slice(1),o);const r=o[0].length?i.join(o[0].slice(-1)[0],s[0]):s[0]||i.sep;return o[0].push(r),o[1].push(i.resolve(i.join(r,U))),e(s.slice(1),o)};return e(n)},ht=t=>{const n=t.split(i.sep).slice(1).reduce((e,s,o)=>(e.push(i.resolve(i.join(o?e[o-1]:i.sep,s))),e),[]).reverse().find(e=>u(i.join(e,p)));return n&&i.join(n,p)},yt=t=>(String(t).match(tt)||[]).slice(1),z=(t,n)=>new RegExp(t.replace(q,"\\$1").replace(A,".*")).test(n),dt=(t,n,e)=>{const s=new RegExp(t.replace(q,"\\$1").replace(A,"(.*)")),o=(e.match(s)||[])[1];return o&&n.replace("*",o)},B=(t,n,e,s=!1)=>(z(t,e)&&(n.includes("*")?z(n,e)?s=e:t.includes("*")&&t!==n&&(s=dt(t,n,e)):s=n),s),C=(t,n,e,s=t[0])=>t.length?(g.test(e)?g.test(s):d.test(s))&&typeof n[s]=="string"&&B(s,n[s],e)||C(t.slice(1),n,e):null,l=(t,n,e={})=>{const s=e.priority||[L,m];let o=!1;return typeof t=="string"?t:(!o&&Array.isArray(t)&&(o=t.reduce((r,c)=>r||l(c,n,e),null)),!o&&it(t)&&(typeof t[n]=="string"&&(o=t[n]),o||(o=s.reduce((r,c)=>r||(c=c===j?x(e.packagejsontype):c,l(t[c],n,e)),!1)),!o&&t[m]&&(o=l(t[m],n)),!o&&t[n]&&(o=l(t[n],n,e)),o||(o=C(Object.keys(t),t,n)),!o&&t[R]&&(s.includes(n)?o=s.reduce((r,c)=>r||(c=c===j?x(e.packagejsontype):c,l(t[R],c,e)),!1):o=l(t[R],n,e))),o)},h=(t,n={})=>{var e=null,s=n.istypescript&&O.test(t)&&t.replace(O,".ts");return u(s)?e=s:u(t)?e=t:e=pt(t,T),e},D=t=>t.type||"exports"in t&&K||V,G=(t,n={},e="")=>{const s=e?i.join(e,t):t;return h(s,n)||!Y.test(t)&&h(i.join(s,"index"))},gt=(t,n={},e="",s=!1)=>{const o=n.packagejsontype;return n.isspectype!==!1&&(s=t[o]||t[x(o)]),!s&&(n.priority||[]).includes(M)&&t.module&&(s=G(t.module,n,e)),!s&&t.main&&(s=G(t.main,n,e)),s||null},J=(t,n={},e="",s)=>{const o=D(t),r=Object.assign({packagejsontype:o},n);return n.isbrowser&&t.browser&&(s=l(t.browser,N,r)),!s&&t.exports&&(s=l(t.exports,o,r)),s||(s=gt(t,r,e)),s},Z=(t,n)=>{const e=i.join(t,p),s=u(e)&&y(e),o=s?J(s,n,t):!1;return o||mt(t,nt)},v=(t,n,e)=>{const s=d.test(t)?i.join(n,t):t;return h(s,e)||Z(s,e)},jt=(t,n,e,s)=>{const o=e&&e.imports,r=l(o,n,s);return r&&(d.test(r)?i.join(t,r):Q(r,t,{isposixpath:!0}))},Rt=(t,n,e,s,o)=>{const r=l(s&&s.exports,e?"./"+e:N,o);return r&&i.join(t,n,r)},bt=(t,n,e,s)=>{const o=i.join(t,n,p),r=u(o),c=r&&y(o),a=c&&D(c);return r&&Rt(t,n,e,c,Object.assign({packagejsontype:a},s))},xt=(t,n,e)=>{const s=ht(n),o=i.dirname(s);return s&&jt(o,t,y(s),e)},wt=(t,n,e)=>{const[s,o]=yt(t);if(g.test(s))return xt(t,n,e);const r=W(n);return function c(a,f){return f--?bt(i.join(a[f]),s,o,e)||v(i.join(a[f],t),null,e)||c(r,f):null}(r,r.length)},St=(t,n,e)=>{var s=null;return n=typeof n=="string"?ft(at(decodeURI(n))):process.cwd(),P.test(t)?s=ct(t):(s=X.test(t)?v(w(t),n,e):wt(t,n,e),s=s&&(e.isposixpath?E(s):lt(w(E(s))))),s},H=(t,n,e)=>{const s=(o,r)=>typeof o=="boolean"?o:r;return e=e||{},e.istypescript=s(e.istypescript,I.test(n)),e.isbrowser=s(e.isbrowser,!1),e.isspectype=s(e.isspectype,!0),Array.isArray(e.priority)||(e.priority=e.isbrowser?[ot]:[],e.priority.push(j),e.priority.push(L),e.priority.push(m)),e},Q=(t,n,e)=>{let s=b[t+n];return s||(e=H(t,n,e),s=St(t,n,e),b[t+n]=s)};export default Object.assign(Q,{pathToPosix:w,getasnode_module_paths:W,getesmkeyvalmatch:B,getasfilesync:h,getasdirsync:Z,gettargetindex:J,iscoremodule:ut,createopts:H,esmparse:l,cache:b}); | ||
import w from"fs";import S from"url";import i from"path";import _ from"module";const $=_.createRequire(import.meta.url),E=w.realpathSync.native,P=new RegExp("^(?:node:)?("+_.builtinModules.join("|").replace("/","/")+")$"),F=/^\.?\.?([a-zA-Z]:)?(\/|\\)/,g=/^.\.?(?=\/|\\)/,O=/\\/g,v=/index.[tj]sx?$/,I=/[\\/]resolvewithplus[\\/]/,A=/\.js$/,tt=/\.ts$/,et=/(^@[^/]*\/[^/]*|^[^/]*)\/?(.*)$/,h=/^#/,k=/(\*)/g,q=/([./])/g,st=/^node:/,nt=/^file:/,T=[".js",".mjs",".ts",".tsx",".json",".node"],ot=T.map(t=>`index${t}`),U="node_modules",f="package.json",L="node",p="default",rt="browser",N="import",y=":spectype",K="module",M="import",V="commonjs",it="require",j=".",ct=t=>t&&typeof t=="object",d={},R=t=>({[K]:M,[V]:it})[t]||null,lt=t=>st.test(t)?t:`node:${t}`,at=t=>t&&S.pathToFileURL(t).href,ut=t=>P.test(t),ft=t=>nt.test(t)?S.fileURLToPath(t):t,pt=t=>i.resolve(i.extname(t)?i.dirname(t):t)+i.sep,b=t=>O.test(t)?t.replace(O,i.posix.sep):t,a=(t,n)=>{try{n=w.statSync(t)}catch{n=!1}return n&&(n.isFile()||n.isFIFO())},W=(t,n)=>n.packagejsonmap&&n.packagejsonmap[t]||a(t)&&$(t),mt=(t,n)=>{const e=n.find(s=>a(t+s))||null;return e&&t+e},gt=(t,n)=>{const e=n.find(s=>a(i.join(t,s)))||null;return e&&i.join(t,e)},z=(t,n=t.split(i.sep))=>{const e=(s,o=[[],[]])=>{if(!s.length)return o[1];if(s[0]===U&&I.test(t))return e(s.slice(1),o);const r=o[0].length?i.join(o[0].slice(-1)[0],s[0]):s[0]||i.sep;return o[0].push(r),o[1].push(i.resolve(i.join(r,U))),e(s.slice(1),o)};return e(n)},ht=t=>{const n=t.split(i.sep).slice(1).reduce((e,s,o)=>(e.push(i.resolve(i.join(o?e[o-1]:i.sep,s))),e),[]).reverse().find(e=>a(i.join(e,f)));return n&&i.join(n,f)},yt=t=>(String(t).match(et)||[]).slice(1),B=(t,n)=>new RegExp(t.replace(q,"\\$1").replace(k,".*")).test(n),jt=(t,n,e)=>{const s=new RegExp(t.replace(q,"\\$1").replace(k,"(.*)")),o=(e.match(s)||[])[1];return o&&n.replace("*",o)},C=(t,n,e,s=!1)=>(B(t,e)&&(n.includes("*")?B(n,e)?s=e:t.includes("*")&&t!==n&&(s=jt(t,n,e)):s=n),s),D=(t,n,e,s=t[0])=>t.length?(h.test(e)?h.test(s):g.test(s))&&typeof n[s]=="string"&&C(s,n[s],e)||D(t.slice(1),n,e):null,l=(t,n,e={})=>{const s=e.priority||[L,p];let o=!1;return typeof t=="string"?t:(!o&&Array.isArray(t)&&(o=t.reduce((r,c)=>r||l(c,n,e),null)),!o&&ct(t)&&(typeof t[n]=="string"&&(o=t[n]),o||(o=s.reduce((r,c)=>r||(c=c===y?R(e.packagejsontype):c,l(t[c],n,e)),!1)),!o&&t[p]&&(o=l(t[p],n)),!o&&t[n]&&(o=l(t[n],n,e)),o||(o=D(Object.keys(t),t,n)),!o&&t[j]&&(s.includes(n)?o=s.reduce((r,c)=>r||(c=c===y?R(e.packagejsontype):c,l(t[j],c,e)),!1):o=l(t[j],n,e))),o)},m=(t,n={})=>{var e=null,s=n.istypescript&&A.test(t)&&t.replace(A,".ts");return a(s)?e=s:a(t)?e=t:e=mt(t,T),e},G=t=>t.type||"exports"in t&&K||V,J=(t,n={},e="")=>{const s=e?i.join(e,t):t;return m(s,n)||!v.test(t)&&m(i.join(s,"index"))},dt=(t,n={},e="",s=!1)=>{const o=n.packagejsontype;return n.isspectype!==!1&&(s=t[o]||t[R(o)]),!s&&(n.priority||[]).includes(M)&&t.module&&(s=J(t.module,n,e)),!s&&t.main&&(s=J(t.main,n,e)),s||null},Z=(t,n={},e="",s)=>{const o=G(t),r=Object.assign({packagejsontype:o},n);return n.isbrowser&&t.browser&&(s=l(t.browser,N,r),s=s&&!F.test(s)?i.join(e,s):s),s||(s=dt(t,r,e)),s},H=(t,n)=>{const e=i.join(t,f),s=W(e,n),o=s?Z(s,n,t):!1;return o||gt(t,ot)},Q=(t,n,e)=>{const s=g.test(t)?i.join(n,t):t;return m(s,e)||H(s,e)},Rt=(t,n,e,s)=>{const o=e&&e.imports,r=l(o,n,s);return r&&(g.test(r)?i.join(t,r):Y(r,t,{isposixpath:!0}))},bt=(t,n,e,s,o)=>{const r=l(s&&s.exports,e?"./"+e:N,o);return r&&i.join(t,n,r)},xt=(t,n,e,s)=>{const o=i.join(t,n,f),r=W(o,s),c=r&&G(r);return r&&bt(t,n,e,r,Object.assign({packagejsontype:c},s))},wt=(t,n,e)=>{const s=ht(n),o=i.dirname(s);return s&&Rt(o,t,$(s),e)},St=(t,n,e)=>{const[s,o]=yt(t);if(h.test(s))return wt(t,n,e);const r=z(n);return function c(x,u){return u--?xt(i.join(x[u]),s,o,e)||Q(i.join(x[u],t),null,e)||c(r,u):null}(r,r.length)},_t=(t,n,e)=>{var s=null;return n=typeof n=="string"?pt(ft(decodeURI(n))):process.cwd(),P.test(t)?s=lt(t):(s=F.test(t)?Q(b(t),n,e):St(t,n,e),s=s&&(e.isposixpath?E(s):at(b(E(s))))),s},X=(t,n,e)=>{const s=(o,r)=>typeof o=="boolean"?o:r;return e=e||{},e.istypescript=s(e.istypescript,tt.test(n)),e.isbrowser=s(e.isbrowser,!1),e.isspectype=s(e.isspectype,!0),e.packagejsonmap=e.packagejsonmap||null,Array.isArray(e.priority)||(e.priority=e.isbrowser?[rt]:[],e.priority.push(y),e.priority.push(L),e.priority.push(p)),e},Y=(t,n,e)=>{let s=d[t+n];return s||(e=X(t,n,e),s=_t(t,n,e),d[t+n]=s)};export default Object.assign(Y,{pathToPosix:b,getasnode_module_paths:z,getesmkeyvalmatch:C,getasfilesync:m,getasdirsync:H,gettargetindex:Z,iscoremodule:ut,createopts:X,esmparse:l,cache:d}); |
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
7457