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