Socket
Socket
Sign inDemoInstall

@esbuild-kit/core-utils

Package Overview
Dependencies
26
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.3.1 to 2.3.2

2

dist/index.js

@@ -23,2 +23,2 @@ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var Ne=require("source-map-support"),Re=require("url"),At=require("esbuild"),xe=require("crypto"),Fe=require("fs"),Ye=require("path"),Ge=require("os");function q(i){return i&&typeof i=="object"&&"default"in i?i:{default:i}}var Me=q(Ne),He=q(xe),F=q(Fe),Y=q(Ye),je=q(Ge);function Oe(){if("setSourceMapsEnabled"in process&&typeof Error.prepareStackTrace!="function"){process.setSourceMapsEnabled(!0);return}const t=new Map;return Me.default.install({environment:"node",retrieveSourceMap(A){const n=t.get(A);return n?{url:A,map:n}:null}}),t}const _e=`

})`.replace(/[\n\t]+/g,"");function dt(i){if(!i.includes("import"))return;const[t]=aA(i);if(t.length===0)return;const A=new bt(i);for(const n of t)n.d>-1&&A.appendRight(n.se,cA);return{code:A.toString(),map:A.generateMap({hires:!0})}}function lA(i){try{const t=F.default.readFileSync(i,"utf8");return JSON.parse(t)}catch{}}const xt=()=>Math.floor(Date.now()/1e8);class uA extends Map{cacheDirectory=Y.default.join(je.default.tmpdir(),"esbuild-kit");cacheFiles;constructor(){super(),F.default.mkdirSync(this.cacheDirectory,{recursive:!0}),this.cacheFiles=F.default.readdirSync(this.cacheDirectory).map(t=>{const[A,n]=t.split("-");return{time:Number(A),key:n,fileName:t}}),setImmediate(()=>this.expireDiskCache())}get(t){const A=super.get(t);if(A)return A;const n=this.cacheFiles.find(c=>c.key===t);if(!n)return;const s=Y.default.join(this.cacheDirectory,n.fileName),a=lA(s);if(!a){F.default.promises.unlink(s).then(()=>{const c=this.cacheFiles.indexOf(n);this.cacheFiles.splice(c,1)},()=>{});return}return super.set(t,a),a}set(t,A){if(super.set(t,A),A){const n=xt();F.default.promises.writeFile(Y.default.join(this.cacheDirectory,`${n}-${t}`),JSON.stringify(A)).catch(()=>{})}return this}expireDiskCache(){const t=xt();for(const A of this.cacheFiles)t-A.time>7&&F.default.promises.unlink(Y.default.join(this.cacheDirectory,A.fileName)).catch(()=>{})}}var nt=process.env.ESBK_DISABLE_CACHE?new Map:new uA;const Ft=",".charCodeAt(0),fA=";".charCodeAt(0),Yt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Gt=new Uint8Array(64),Mt=new Uint8Array(128);for(let i=0;i<Yt.length;i++){const t=Yt.charCodeAt(i);Gt[i]=t,Mt[t]=i}const pt=typeof TextDecoder<"u"?new TextDecoder:typeof Buffer<"u"?{decode(i){return Buffer.from(i.buffer,i.byteOffset,i.byteLength).toString()}}:{decode(i){let t="";for(let A=0;A<i.length;A++)t+=String.fromCharCode(i[A]);return t}};function hA(i){const t=new Int32Array(5),A=[];let n=0;do{const s=QA(i,n),a=[];let c=!0,C=0;t[0]=0;for(let h=n;h<s;h++){let g;h=$(i,h,t,0);const f=t[0];f<C&&(c=!1),C=f,Ht(i,h,s)?(h=$(i,h,t,1),h=$(i,h,t,2),h=$(i,h,t,3),Ht(i,h,s)?(h=$(i,h,t,4),g=[f,t[1],t[2],t[3],t[4]]):g=[f,t[1],t[2],t[3]]):g=[f],a.push(g)}c||gA(a),A.push(a),n=s+1}while(n<=i.length);return A}function QA(i,t){const A=i.indexOf(";",t);return A===-1?i.length:A}function $(i,t,A,n){let s=0,a=0,c=0;do{const h=i.charCodeAt(t++);c=Mt[h],s|=(c&31)<<a,a+=5}while(c&32);const C=s&1;return s>>>=1,C&&(s=-2147483648|-s),A[n]+=s,t}function Ht(i,t,A){return t>=A?!1:i.charCodeAt(t)!==Ft}function gA(i){i.sort(CA)}function CA(i,t){return i[0]-t[0]}function BA(i){const t=new Int32Array(5),A=1024*16,n=A-36,s=new Uint8Array(A),a=s.subarray(0,n);let c=0,C="";for(let h=0;h<i.length;h++){const g=i[h];if(h>0&&(c===A&&(C+=pt.decode(s),c=0),s[c++]=fA),g.length!==0){t[0]=0;for(let f=0;f<g.length;f++){const r=g[f];c>n&&(C+=pt.decode(a),s.copyWithin(0,n,c),c-=n),f>0&&(s[c++]=Ft),c=W(s,c,t,r,0),r.length!==1&&(c=W(s,c,t,r,1),c=W(s,c,t,r,2),c=W(s,c,t,r,3),r.length!==4&&(c=W(s,c,t,r,4)))}}}return C+pt.decode(s.subarray(0,c))}function W(i,t,A,n,s){const a=n[s];let c=a-A[s];A[s]=a,c=c<0?-c<<1|1:c<<1;do{let C=c&31;c>>>=5,c>0&&(C|=32),i[t++]=Gt[C]}while(c>0);return t}const EA=/^[\w+.-]+:\/\//,dA=/^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?/,pA=/^file:(?:\/\/((?![a-z]:)[^/]*)?)?(\/?.*)/i;function wA(i){return EA.test(i)}function IA(i){return i.startsWith("//")}function jt(i){return i.startsWith("/")}function kA(i){return i.startsWith("file:")}function it(i){const t=dA.exec(i);return Ot(t[1],t[2]||"",t[3],t[4]||"",t[5]||"/")}function bA(i){const t=pA.exec(i),A=t[2];return Ot("file:","",t[1]||"","",jt(A)?A:"/"+A)}function Ot(i,t,A,n,s){return{scheme:i,user:t,host:A,port:n,path:s,relativePath:!1}}function _t(i){if(IA(i)){const A=it("http:"+i);return A.scheme="",A}if(jt(i)){const A=it("http://foo.com"+i);return A.scheme="",A.host="",A}if(kA(i))return bA(i);if(wA(i))return it(i);const t=it("http://foo.com/"+i);return t.scheme="",t.host="",t.relativePath=!0,t}function mA(i){if(i.endsWith("/.."))return i;const t=i.lastIndexOf("/");return i.slice(0,t+1)}function DA(i,t){!i.relativePath||(qt(t),i.path==="/"?i.path=t.path:i.path=mA(t.path)+i.path,i.relativePath=t.relativePath)}function qt(i){const{relativePath:t}=i,A=i.path.split("/");let n=1,s=0,a=!1;for(let C=1;C<A.length;C++){const h=A[C];if(!h){a=!0;continue}if(a=!1,h!=="."){if(h===".."){s?(a=!0,s--,n--):t&&(A[n++]=h);continue}A[n++]=h,s++}}let c="";for(let C=1;C<n;C++)c+="/"+A[C];(!c||a&&!c.endsWith("/.."))&&(c+="/"),i.path=c}function JA(i,t){if(!i&&!t)return"";const A=_t(i);if(t&&!A.scheme){const n=_t(t);A.scheme=n.scheme,A.host||(A.user=n.user,A.host=n.host,A.port=n.port),DA(A,n)}if(qt(A),A.relativePath){const n=A.path.slice(1);return n?!(t||i).startsWith(".")||n.startsWith(".")?n:"./"+n:"."}return!A.scheme&&!A.host?A.path:`${A.scheme}//${A.user}${A.host}${A.port}${A.path}`}function Pt(i,t){return t&&!t.endsWith("/")&&(t+="/"),JA(i,t)}function SA(i){if(!i)return"";const t=i.lastIndexOf("/");return i.slice(0,t+1)}const R=0;function KA(i,t){const A=Tt(i,0);if(A===i.length)return i;t||(i=i.slice());for(let n=A;n<i.length;n=Tt(i,n+1))i[n]=LA(i[n],t);return i}function Tt(i,t){for(let A=t;A<i.length;A++)if(!yA(i[A]))return A;return i.length}function yA(i){for(let t=1;t<i.length;t++)if(i[t][R]<i[t-1][R])return!1;return!0}function LA(i,t){return t||(i=i.slice()),i.sort(vA)}function vA(i,t){return i[R]-t[R]}let st=!1;function UA(i,t,A,n){for(;A<=n;){const s=A+(n-A>>1),a=i[s][R]-t;if(a===0)return st=!0,s;a<0?A=s+1:n=s-1}return st=!1,A-1}function NA(i,t,A){for(let n=A+1;n<i.length&&i[n][R]===t;A=n++);return A}function RA(i,t,A){for(let n=A-1;n>=0&&i[n][R]===t;A=n--);return A}function xA(){return{lastKey:-1,lastNeedle:-1,lastIndex:-1}}function FA(i,t,A,n){const{lastKey:s,lastNeedle:a,lastIndex:c}=A;let C=0,h=i.length-1;if(n===s){if(t===a)return st=c!==-1&&i[c][R]===t,c;t>=a?C=c===-1?0:c:h=c}return A.lastKey=n,A.lastNeedle=t,A.lastIndex=UA(i,t,C,h)}const Xt=-1,YA=1;let wt,$t;class Wt{constructor(t,A){this._decodedMemo=xA(),this._bySources=void 0,this._bySourceMemos=void 0;const n=typeof t=="string";if(!n&&t._decodedMemo)return t;const s=n?JSON.parse(t):t,{version:a,file:c,names:C,sourceRoot:h,sources:g,sourcesContent:f}=s;this.version=a,this.file=c,this.names=C,this.sourceRoot=h,this.sources=g,this.sourcesContent=f;const r=Pt(h||"",SA(A));this.resolvedSources=g.map(m=>Pt(m||"",r));const{mappings:E}=s;typeof E=="string"?(this._encoded=E,this._decoded=void 0):(this._encoded=void 0,this._decoded=KA(E,n))}}wt=i=>i._decoded||(i._decoded=hA(i._encoded)),$t=(i,t,A)=>{const n=wt(i);return t>=n.length?null:GA(n[t],i._decodedMemo,t,A,YA)};function GA(i,t,A,n,s){let a=FA(i,n,t,A);return st?a=(s===Xt?NA:RA)(i,n,a):s===Xt&&a++,a===-1||a===i.length?null:i[a]}let Vt,ot;class zt{constructor(){this._indexes={__proto__:null},this.array=[]}}Vt=(i,t)=>i._indexes[t],ot=(i,t)=>{const A=Vt(i,t);if(A!==void 0)return A;const{array:n,_indexes:s}=i;return s[t]=n.push(t)-1};let Zt,te,It,ee;class MA{constructor({file:t,sourceRoot:A}={}){this._names=new zt,this._sources=new zt,this._sourcesContent=[],this._mappings=[],this.file=t,this.sourceRoot=A}}Zt=(i,t,A,n,s,a,c)=>{const{_mappings:C,_sources:h,_sourcesContent:g,_names:f}=i,r=HA(C,t);if(n==null){const y=[A],v=Ae(r,A,y);return re(r,v,y)}const E=ot(h,n),m=c?[A,E,s,a,ot(f,c)]:[A,E,s,a],I=Ae(r,A,m);E===g.length&&(g[E]=null),re(r,I,m)},te=(i,t,A)=>{const{_sources:n,_sourcesContent:s}=i;s[ot(n,t)]=A},It=i=>{const{file:t,sourceRoot:A,_mappings:n,_sources:s,_sourcesContent:a,_names:c}=i;return{version:3,file:t,names:c.array,sourceRoot:A||void 0,sources:s.array,sourcesContent:a,mappings:n}},ee=i=>{const t=It(i);return Object.assign(Object.assign({},t),{mappings:BA(t.mappings)})};function HA(i,t){for(let A=i.length;A<=t;A++)i[A]=[];return i[t]}function Ae(i,t,A){let n=i.length;for(let s=n-1;s>=0;s--,n--){const a=i[s],c=a[0];if(c>t)continue;if(c<t)break;const C=jA(a,A);if(C===0)return n;if(C<0)break}return n}function jA(i,t){let A=V(i.length,t.length);return A!==0?A:i.length===1?0:(A=V(i[1],t[1]),A!==0||(A=V(i[2],t[2]),A!==0)||(A=V(i[3],t[3]),A!==0)?A:i.length===4?0:V(i[4],t[4]))}function V(i,t){return i-t}function re(i,t,A){if(t!==-1){for(let n=i.length;n>t;n--)i[n]=i[n-1];i[t]=A}}const ne={source:null,column:null,line:null,name:null,content:null},OA=[];function ie(i,t,A,n){return{map:i,sources:t,source:A,content:n}}function se(i,t){return ie(i,t,"",null)}function _A(i,t){return ie(null,OA,i,t)}function qA(i){const t=new MA({file:i.map.file}),{sources:A,map:n}=i,s=n.names,a=wt(n);for(let c=0;c<a.length;c++){const C=a[c];let h=null,g=null,f=null;for(let r=0;r<C.length;r++){const E=C[r],m=E[0];let I=ne;if(E.length!==1){const et=A[E[1]];if(I=oe(et,E[2],E[3],E.length===5?s[E[4]]:""),I==null)continue}const{column:y,line:v,name:Z,content:tt,source:U}=I;v===g&&y===f&&U===h||(g=v,f=y,h=U,Zt(t,c,m,U,v,y,Z),tt!=null&&te(t,U,tt))}}return t}function oe(i,t,A,n){if(!i.map)return{column:A,line:t,name:n,source:i.source,content:i.content};const s=$t(i.map,t,A);return s==null?null:s.length===1?ne:oe(i.sources[s[1]],s[2],s[3],s.length===5?i.map.names[s[4]]:n)}function PA(i){return Array.isArray(i)?i:[i]}function TA(i,t){const A=PA(i).map(a=>new Wt(a,"")),n=A.pop();for(let a=0;a<A.length;a++)if(A[a].sources.length>1)throw new Error(`Transformation map ${a} must have exactly one source file.
Did you specify these with the most recent transformation maps first?`);let s=ae(n,t,"",0);for(let a=A.length-1;a>=0;a--)s=se(A[a],[s]);return s}function ae(i,t,A,n){const{resolvedSources:s,sourcesContent:a}=i,c=n+1,C=s.map((h,g)=>{const f={importer:A,depth:c,source:h||"",content:void 0},r=t(f.source,f),{source:E,content:m}=f;if(r)return ae(new Wt(r,E),t,E,c);const I=m!==void 0?m:a?a[g]:null;return _A(E,I)});return se(i,C)}class XA{constructor(t,A){const n=A.decodedMappings?It(t):ee(t);this.version=n.version,this.file=n.file,this.mappings=n.mappings,this.names=n.names,this.sourceRoot=n.sourceRoot,this.sources=n.sources,A.excludeContent||(this.sourcesContent=n.sourcesContent)}toString(){return JSON.stringify(this)}}function ce(i,t,A){const n=typeof A=="object"?A:{excludeContent:!!A,decodedMappings:!1},s=TA(i,t);return new XA(qA(s),n)}function $A(i,t){const A=[],n={code:i,map:""};for(const s of t){const a=s(n.code);a&&(Object.assign(n,a),A.unshift(a.map))}return n.map=A.length>1?ce(A,()=>null).toString():A[0].toString(),n}async function WA(i,t){const A=[],n={code:i,map:""};for(const s of t){const a=await s(n.code);a&&(Object.assign(n,a),A.unshift(a.map))}return n.map=A.length>1?ce(A,()=>null).toString():A[0].toString(),n}const VA=process.versions.node,le=i=>{const t={target:`node${VA}`,loader:"default",sourcemap:!0,minifySyntax:!0,minifyWhitespace:!0,keepNames:!0,...i};if(t.sourcefile){const{sourcefile:A}=t,n=Y.default.extname(A);n?(n===".cts"||n===".mts")&&(t.sourcefile=`${A.slice(0,-3)}ts`):t.sourcefile+=".js"}return t};function zA(i,t,A){const n={};t.endsWith(".cjs")||t.endsWith(".cts")||(n["import.meta.url"]=`'${Re.pathToFileURL(t)}'`);const s=le({format:"cjs",sourcefile:t,define:n,...A}),a=St(i+JSON.stringify(s)+At.version),c=nt.get(a);if(c)return c;const C=$A(i,[h=>{const g=At.transformSync(h,s);return s.sourcefile!==t&&(g.map=g.map.replace(`"${s.sourcefile}"`,`"${t}"`)),g},dt]);if(C.warnings.length>0){const{warnings:h}=C;for(const g of h)console.log(g)}return nt.set(a,C),C}async function ZA(i,t,A){const n=le({format:"esm",sourcefile:t,...A}),s=St(i+JSON.stringify(n)+At.version),a=nt.get(s);if(a)return a;const c=await WA(i,[async C=>{const h=await At.transform(C,n);return n.sourcefile!==t&&(h.map=h.map.replace(`"${n.sourcefile}"`,`"${t}"`)),h},dt]);if(c.warnings.length>0){const{warnings:C}=c;for(const h of C)console.log(h)}return nt.set(s,c),c}const tr={".js":".ts",".cjs":".cts",".mjs":".mts"};function er(i){const t=Y.default.extname(i),A=tr[t];if(A)return i.slice(0,-t.length)+A}const kt=process.versions.node.split(".").map(Number),Ar=i=>kt[0]-i[0]||kt[1]-i[1]||kt[2]-i[2];exports.applySourceMap=qe,exports.compareNodeVersion=Ar,exports.installSourceMapSupport=Oe,exports.resolveTsPath=er,exports.transform=ZA,exports.transformDynamicImport=dt,exports.transformSync=zA;
Did you specify these with the most recent transformation maps first?`);let s=ae(n,t,"",0);for(let a=A.length-1;a>=0;a--)s=se(A[a],[s]);return s}function ae(i,t,A,n){const{resolvedSources:s,sourcesContent:a}=i,c=n+1,C=s.map((h,g)=>{const f={importer:A,depth:c,source:h||"",content:void 0},r=t(f.source,f),{source:E,content:m}=f;if(r)return ae(new Wt(r,E),t,E,c);const I=m!==void 0?m:a?a[g]:null;return _A(E,I)});return se(i,C)}class XA{constructor(t,A){const n=A.decodedMappings?It(t):ee(t);this.version=n.version,this.file=n.file,this.mappings=n.mappings,this.names=n.names,this.sourceRoot=n.sourceRoot,this.sources=n.sources,A.excludeContent||(this.sourcesContent=n.sourcesContent)}toString(){return JSON.stringify(this)}}function ce(i,t,A){const n=typeof A=="object"?A:{excludeContent:!!A,decodedMappings:!1},s=TA(i,t);return new XA(qA(s),n)}function $A(i,t){const A=[],n={code:i,map:""};for(const s of t){const a=s(n.code);a&&(Object.assign(n,a),A.unshift(a.map))}return n.map=A.length>1?ce(A,()=>null).toString():A[0].toString(),n}async function WA(i,t){const A=[],n={code:i,map:""};for(const s of t){const a=await s(n.code);a&&(Object.assign(n,a),A.unshift(a.map))}return n.map=A.length>1?ce(A,()=>null).toString():A[0].toString(),n}const VA=process.versions.node,le=i=>{const t={target:`node${VA}`,loader:"default",sourcemap:!0,minifyWhitespace:!0,keepNames:!0,...i};if(t.sourcefile){const{sourcefile:A}=t,n=Y.default.extname(A);n?(n===".cts"||n===".mts")&&(t.sourcefile=`${A.slice(0,-3)}ts`):t.sourcefile+=".js"}return t};function zA(i,t,A){const n={};t.endsWith(".cjs")||t.endsWith(".cts")||(n["import.meta.url"]=`'${Re.pathToFileURL(t)}'`);const s=le({format:"cjs",sourcefile:t,define:n,...A}),a=St(i+JSON.stringify(s)+At.version),c=nt.get(a);if(c)return c;const C=$A(i,[h=>{const g=At.transformSync(h,s);return s.sourcefile!==t&&(g.map=g.map.replace(`"${s.sourcefile}"`,`"${t}"`)),g},dt]);if(C.warnings.length>0){const{warnings:h}=C;for(const g of h)console.log(g)}return nt.set(a,C),C}async function ZA(i,t,A){const n=le({format:"esm",sourcefile:t,...A}),s=St(i+JSON.stringify(n)+At.version),a=nt.get(s);if(a)return a;const c=await WA(i,[async C=>{const h=await At.transform(C,n);return n.sourcefile!==t&&(h.map=h.map.replace(`"${n.sourcefile}"`,`"${t}"`)),h},dt]);if(c.warnings.length>0){const{warnings:C}=c;for(const h of C)console.log(h)}return nt.set(s,c),c}const tr={".js":".ts",".cjs":".cts",".mjs":".mts"};function er(i){const t=Y.default.extname(i),A=tr[t];if(A)return i.slice(0,-t.length)+A}const kt=process.versions.node.split(".").map(Number),Ar=i=>kt[0]-i[0]||kt[1]-i[1]||kt[2]-i[2];exports.applySourceMap=qe,exports.compareNodeVersion=Ar,exports.installSourceMapSupport=Oe,exports.resolveTsPath=er,exports.transform=ZA,exports.transformDynamicImport=dt,exports.transformSync=zA;
{
"name": "@esbuild-kit/core-utils",
"version": "2.3.1",
"version": "2.3.2",
"publishConfig": {

@@ -5,0 +5,0 @@ "access": "public"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc