@node-projects/jszip
Advanced tools
| var Le=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var Ue=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",Ne=typeof Buffer<"u",We=typeof Uint8Array<"u",j=!1;if(typeof ArrayBuffer>"u")j=!1;else{pe=new ArrayBuffer(0);try{j=new Blob([pe],{type:"application/zip"}).size===0}catch{try{Ee=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,me=new Ee,me.append(pe),j=me.getBlob("application/zip").size===0}catch{j=!1}}}var pe,Ee,me,xe=!1;try{xe=!!Le("readable-stream").Readable}catch{xe=!1}var c={base64:!0,array:!0,string:!0,arraybuffer:Ue,nodebuffer:Ne,uint8array:We,blob:j,nodestream:xe};var b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function Me(t){for(var e=[],r,i,s,n,o,u,h,l=0,p=t.length,m=p,v=a.getTypeOf(t)!=="string";l<t.length;)m=p-l,v?(r=t[l++],i=l<p?t[l++]:0,s=l<p?t[l++]:0):(r=t.charCodeAt(l++),i=l<p?t.charCodeAt(l++):0,s=l<p?t.charCodeAt(l++):0),n=r>>2,o=(r&3)<<4|i>>4,u=m>1?(i&15)<<2|s>>6:64,h=m>2?s&63:64,e.push(b.charAt(n)+b.charAt(o)+b.charAt(u)+b.charAt(h));return e.join("")}function je(t){var e,r,i,s,n,o,u,h=0,l=0,p="data:";if(t.substr(0,p.length)===p)throw new Error("Invalid base64 input, it looks like a data url.");t=t.replace(/[^A-Za-z0-9+/=]/g,"");var m=t.length*3/4;if(t.charAt(t.length-1)===b.charAt(64)&&m--,t.charAt(t.length-2)===b.charAt(64)&&m--,m%1!==0)throw new Error("Invalid base64 input, bad content length.");var v;for(c.uint8array?v=new Uint8Array(m|0):v=new Array(m|0);h<t.length;)s=b.indexOf(t.charAt(h++)),n=b.indexOf(t.charAt(h++)),o=b.indexOf(t.charAt(h++)),u=b.indexOf(t.charAt(h++)),e=s<<2|n>>4,r=(n&15)<<4|o>>2,i=(o&3)<<6|u,v[l++]=e,o!==64&&(v[l++]=r),u!==64&&(v[l++]=i);return v}var q={encode:Me,decode:je};var y={isNode:typeof Buffer<"u",newBufferFrom:function(t,e){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(t,e);if(typeof t=="number")throw new Error('The "data" argument must not be a number');return new Buffer(t,e)},allocBuffer:function(t){if(Buffer.alloc)return Buffer.alloc(t);var e=new Buffer(t);return e.fill(0),e},isBuffer:function(t){return Buffer.isBuffer(t)},isStream:function(t){return t&&typeof t.on=="function"&&typeof t.pause=="function"&&typeof t.resume=="function"}};function Ze(t){var e=null;return c.uint8array?e=new Uint8Array(t.length):e=new Array(t.length),Q(t,e)}function Ye(t,e){H("blob");try{return new Blob([t],{type:e})}catch{try{var r=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,i=new r;return i.append(t),i.getBlob(e)}catch{throw new Error("Bug : can't construct the Blob.")}}}function Z(t){return t}function Q(t,e){for(var r=0;r<t.length;++r)e[r]=t.charCodeAt(r)&255;return e}var J={stringifyByChunk:function(t,e,r){var i=[],s=0,n=t.length;if(n<=r)return String.fromCharCode.apply(null,t);for(;s<n;)e==="array"||e==="nodebuffer"?i.push(String.fromCharCode.apply(null,t.slice(s,Math.min(s+r,n)))):i.push(String.fromCharCode.apply(null,t.subarray(s,Math.min(s+r,n)))),s+=r;return i.join("")},stringifyByChar:function(t){for(var e="",r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},applyCanBeUsed:{uint8array:(function(){try{return c.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return c.nodebuffer&&String.fromCharCode.apply(null,y.allocBuffer(1)).length===1}catch{return!1}})()}};function Y(t){var e=65536,r=B(t),i=!0;if(r==="uint8array"?i=J.applyCanBeUsed.uint8array:r==="nodebuffer"&&(i=J.applyCanBeUsed.nodebuffer),i)for(;e>1;)try{return J.stringifyByChunk(t,r,e)}catch{e=Math.floor(e/2)}return J.stringifyByChar(t)}var He=Y;function $(t,e){for(var r=0;r<t.length;r++)e[r]=t[r];return e}var k={};k.string={string:Z,array:function(t){return Q(t,new Array(t.length))},arraybuffer:function(t){return k.string.uint8array(t).buffer},uint8array:function(t){return Q(t,new Uint8Array(t.length))},nodebuffer:function(t){return Q(t,y.allocBuffer(t.length))}};k.array={string:Y,array:Z,arraybuffer:function(t){return new Uint8Array(t).buffer},uint8array:function(t){return new Uint8Array(t)},nodebuffer:function(t){return y.newBufferFrom(t)}};k.arraybuffer={string:function(t){return Y(new Uint8Array(t))},array:function(t){return $(new Uint8Array(t),new Array(t.byteLength))},arraybuffer:Z,uint8array:function(t){return new Uint8Array(t)},nodebuffer:function(t){return y.newBufferFrom(new Uint8Array(t))}};k.uint8array={string:Y,array:function(t){return $(t,new Array(t.length))},arraybuffer:function(t){return t.buffer},uint8array:Z,nodebuffer:function(t){return y.newBufferFrom(t)}};k.nodebuffer={string:Y,array:function(t){return $(t,new Array(t.length))},arraybuffer:function(t){return k.nodebuffer.uint8array(t).buffer},uint8array:function(t){return $(t,new Uint8Array(t.length))},nodebuffer:Z};function I(t,e){if(e||(e=""),!t)return e;H(t);var r=B(e),i=k[r][t](e);return i}function Xe(t){for(var e=t.split("/"),r=[],i=0;i<e.length;i++){var s=e[i];s==="."||s===""&&i!==0&&i!==e.length-1||(s===".."?r.pop():r.push(s))}return r.join("/")}function B(t){if(typeof t=="string")return"string";if(Object.prototype.toString.call(t)==="[object Array]")return"array";if(c.nodebuffer&&y.isBuffer(t))return"nodebuffer";if(c.uint8array&&t instanceof Uint8Array)return"uint8array";if(c.arraybuffer&&t instanceof ArrayBuffer)return"arraybuffer"}function H(t){var e=c[t.toLowerCase()];if(!e)throw new Error(t+" is not supported by this platform")}var Ve=65535,Ge=-1;function Ke(t){var e="",r,i;for(i=0;i<(t||"").length;i++)r=t.charCodeAt(i),e+="\\x"+(r<16?"0":"")+r.toString(16).toUpperCase();return e}function qe(t,e,r){queueMicrotask(function(){t.apply(r||null,e||[])})}function Je(){var t={},e,r;for(e=0;e<arguments.length;e++)for(r in arguments[e])Object.prototype.hasOwnProperty.call(arguments[e],r)&&typeof t[r]>"u"&&(t[r]=arguments[e][r]);return t}function Qe(t,e,r,i,s){var n=Promise.resolve(e).then(function(o){var u=c.blob&&(o instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(o))!==-1);return u&&typeof FileReader<"u"?new Promise(function(h,l){var p=new FileReader;p.onload=function(m){h(m.target.result)},p.onerror=function(m){l(m.target.error)},p.readAsArrayBuffer(o)}):o});return n.then(function(o){var u=B(o);return u?(u==="arraybuffer"?o=I("uint8array",o):u==="string"&&(s?o=q.decode(o):r&&i!==!0&&(o=Ze(o))),o):Promise.reject(new Error("Can't read the data of '"+t+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}var a={newBlob:Ye,applyFromCharCode:He,transformTo:I,resolve:Xe,getTypeOf:B,checkSupport:H,pretty:Ke,delay:qe,extend:Je,prepareContent:Qe,MAX_VALUE_16BITS:Ve,MAX_VALUE_32BITS:Ge};var f=class{constructor(e){this.name=e||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}push(e){this.emit("data",e)}end(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit("error",e)}return!0}error(e){return this.isFinished?!1:(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)}on(e,r){return this._listeners[e].push(r),this}cleanUp(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]}emit(e,r){if(this._listeners[e])for(var i=0;i<this._listeners[e].length;i++)this._listeners[e][i].call(this,r)}pipe(e){return e.registerPrevious(this)}registerPrevious(e){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=e.streamInfo,this.mergeStreamInfo(),this.previous=e;var r=this;return e.on("data",function(i){r.processChunk(i)}),e.on("end",function(){r.end()}),e.on("error",function(i){r.error(i)}),this}pause(){return this.isPaused||this.isFinished?!1:(this.isPaused=!0,this.previous&&this.previous.pause(),!0)}resume(){if(!this.isPaused||this.isFinished)return!1;this.isPaused=!1;var e=!1;return this.generatedError&&(this.error(this.generatedError),e=!0),this.previous&&this.previous.resume(),!e}flush(){}processChunk(e){this.push(e)}withStreamInfo(e,r){return this.extraStreamInfo[e]=r,this.mergeStreamInfo(),this}mergeStreamInfo(){for(var e in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,e)&&(this.streamInfo[e]=this.extraStreamInfo[e])}lock(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()}toString(){var e="Worker "+this.name;return this.previous?this.previous+" -> "+e:e}};var X=new Array(256);for(A=0;A<256;A++)X[A]=A>=252?6:A>=248?5:A>=240?4:A>=224?3:A>=192?2:1;var A;X[254]=X[254]=1;var $e=function(t){var e,r,i,s,n,o=t.length,u=0;for(s=0;s<o;s++)r=t.charCodeAt(s),(r&64512)===55296&&s+1<o&&(i=t.charCodeAt(s+1),(i&64512)===56320&&(r=65536+(r-55296<<10)+(i-56320),s++)),u+=r<128?1:r<2048?2:r<65536?3:4;for(c.uint8array?e=new Uint8Array(u):e=new Array(u),n=0,s=0;n<u;s++)r=t.charCodeAt(s),(r&64512)===55296&&s+1<o&&(i=t.charCodeAt(s+1),(i&64512)===56320&&(r=65536+(r-55296<<10)+(i-56320),s++)),r<128?e[n++]=r:r<2048?(e[n++]=192|r>>>6,e[n++]=128|r&63):r<65536?(e[n++]=224|r>>>12,e[n++]=128|r>>>6&63,e[n++]=128|r&63):(e[n++]=240|r>>>18,e[n++]=128|r>>>12&63,e[n++]=128|r>>>6&63,e[n++]=128|r&63);return e},er=function(t,e){var r;for(e=e||t.length,e>t.length&&(e=t.length),r=e-1;r>=0&&(t[r]&192)===128;)r--;return r<0||r===0?e:r+X[t[r]]>e?r:e},rr=function(t){var e,r,i,s,n=t.length,o=new Array(n*2);for(r=0,e=0;e<n;){if(i=t[e++],i<128){o[r++]=i;continue}if(s=X[i],s>4){o[r++]=65533,e+=s-1;continue}for(i&=s===2?31:s===3?15:7;s>1&&e<n;)i=i<<6|t[e++]&63,s--;if(s>1){o[r++]=65533;continue}i<65536?o[r++]=i:(i-=65536,o[r++]=55296|i>>10&1023,o[r++]=56320|i&1023)}return o.length!==r&&(o.subarray?o=o.subarray(0,r):o.length=r),a.applyFromCharCode(o)};function be(t){return c.nodebuffer?y.newBufferFrom(t,"utf-8"):$e(t)}function ge(t){return c.nodebuffer?a.transformTo("nodebuffer",t).toString("utf-8"):(t=a.transformTo(c.uint8array?"uint8array":"array",t),rr(t))}var ye=class extends f{constructor(){super("utf-8 decode"),this.leftOver=null}processChunk(e){var r=a.transformTo(c.uint8array?"uint8array":"array",e.data);if(this.leftOver&&this.leftOver.length){if(c.uint8array){var i=r;r=new Uint8Array(i.length+this.leftOver.length),r.set(this.leftOver,0),r.set(i,this.leftOver.length)}else r=this.leftOver.concat(r);this.leftOver=null}var s=er(r),n=r;s!==r.length&&(c.uint8array?(n=r.subarray(0,s),this.leftOver=r.subarray(s,r.length)):(n=r.slice(0,s),this.leftOver=r.slice(s,r.length))),this.push({data:ge(n),meta:e.meta})}flush(){this.leftOver&&this.leftOver.length&&(this.push({data:ge(this.leftOver),meta:{}}),this.leftOver=null)}},ve=class extends f{constructor(){super("utf-8 encode")}processChunk(e){this.push({data:be(e.data),meta:e.meta})}},x={utf8encode:be,utf8decode:ge,Utf8DecodeWorker:ye,Utf8EncodeWorker:ve};import ir from"pako";var tr=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",sr=tr?"uint8array":"array",nr="\b\0",ee=class extends f{constructor(e,r){super("FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=r,this.meta={}}processChunk(e){this.meta=e.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(sr,e.data),!1)}flush(){f.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)}cleanUp(){f.prototype.cleanUp.call(this),this._pako=null}_createPako(){this._pako=new ir[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(r){e.push({data:r,meta:e.meta})}}};function or(t){return new ee("Deflate",t)}function ar(){return new ee("Inflate",{})}var Ae={magic:nr,compressWorker:or,uncompressWorker:ar};var fr={magic:"\0\0",compressWorker:function(){return new f("STORE compression")},uncompressWorker:function(){return new f("STORE decompression")}},hr=Ae,O={STORE:fr,DEFLATE:hr};function ur(){for(var t,e=[],r=0;r<256;r++){t=r;for(var i=0;i<8;i++)t=t&1?3988292384^t>>>1:t>>>1;e[r]=t}return e}var _e=ur();function lr(t,e,r,i){var s=_e,n=i+r;t=t^-1;for(var o=i;o<n;o++)t=t>>>8^s[(t^e[o])&255];return t^-1}function cr(t,e,r,i){var s=_e,n=i+r;t=t^-1;for(var o=i;o<n;o++)t=t>>>8^s[(t^e.charCodeAt(o))&255];return t^-1}function _(t,e){if(typeof t>"u"||!t.length)return 0;var r=a.getTypeOf(t)!=="string";return r?lr(e|0,t,t.length,0):cr(e|0,t,t.length,0)}var dr="PK",pr="PK",mr="PK",xr="PK\x07",gr="PK",yr="PK\x07\b",g={LOCAL_FILE_HEADER:dr,CENTRAL_FILE_HEADER:pr,CENTRAL_DIRECTORY_END:mr,ZIP64_CENTRAL_DIRECTORY_LOCATOR:xr,ZIP64_CENTRAL_DIRECTORY_END:gr,DATA_DESCRIPTOR:yr};var d=function(t,e){var r="",i;for(i=0;i<e;i++)r+=String.fromCharCode(t&255),t=t>>>8;return r},vr=function(t,e){var r=t;return t||(r=e?16893:33204),(r&65535)<<16},Cr=function(t){return(t||0)&63},ke=function(t,e,r,i,s,n){var o=t.file,u=t.compression,h=n!==x.utf8encode,l=a.transformTo("string",n(o.name)),p=a.transformTo("string",x.utf8encode(o.name)),m=o.comment,v=a.transformTo("string",n(m)),Ce=a.transformTo("string",x.utf8encode(m)),Se=p.length!==o.name.length,we=Ce.length!==m.length,w,E,M="",he="",ue="",le=o.dir,T=o.date,D={crc32:0,compressedSize:0,uncompressedSize:0};(!e||r)&&(D.crc32=t.crc32,D.compressedSize=t.compressedSize,D.uncompressedSize=t.uncompressedSize);var ce=0;e&&(ce|=8),!h&&(Se||we)&&(ce|=2048);var K=0,de=0;le&&(K|=16),s==="UNIX"?(de=798,K|=vr(o.unixPermissions,le)):(de=20,K|=Cr(o.dosPermissions,le)),w=T.getUTCHours(),w=w<<6,w=w|T.getUTCMinutes(),w=w<<5,w=w|T.getUTCSeconds()/2,E=T.getUTCFullYear()-1980,E=E<<4,E=E|T.getUTCMonth()+1,E=E<<5,E=E|T.getUTCDate(),Se&&(he=d(1,1)+d(_(l),4)+p,M+="up"+d(he.length,2)+he),we&&(ue=d(1,1)+d(_(v),4)+Ce,M+="uc"+d(ue.length,2)+ue);var C="";C+=` | ||
| \0`,C+=d(ce,2),C+=u.magic,C+=d(w,2),C+=d(E,2),C+=d(D.crc32,4),C+=d(D.compressedSize,4),C+=d(D.uncompressedSize,4),C+=d(l.length,2),C+=d(M.length,2);var Pe=g.LOCAL_FILE_HEADER+C+l+M,ze=g.CENTRAL_FILE_HEADER+d(de,2)+C+d(v.length,2)+"\0\0\0\0"+d(K,4)+d(i,4)+l+M+v;return{fileRecord:Pe,dirRecord:ze}},Sr=function(t,e,r,i,s){var n="",o=a.transformTo("string",s(i));return n=g.CENTRAL_DIRECTORY_END+"\0\0\0\0"+d(t,2)+d(t,2)+d(e,4)+d(r,4)+d(o.length,2)+o,n},wr=function(t){var e="";return e=g.DATA_DESCRIPTOR+d(t.crc32,4)+d(t.compressedSize,4)+d(t.uncompressedSize,4),e},re=class extends f{constructor(e,r,i,s){super("ZipFileWorker"),this.bytesWritten=0,this.zipComment=r,this.zipPlatform=i,this.encodeFileName=s,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}push(e){var r=e.meta.percent||0,i=this.entriesCount,s=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,f.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:i?(r+100*(i-s-1))/i:100}}))}openedSource(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var r=this.streamFiles&&!e.file.dir;if(r){var i=ke(e,r,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:i.fileRecord,meta:{percent:0}})}else this.accumulate=!0}closedSource(e){this.accumulate=!1;var r=this.streamFiles&&!e.file.dir,i=ke(e,r,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(i.dirRecord),r)this.push({data:wr(e),meta:{percent:100}});else for(this.push({data:i.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null}flush(){for(var e=this.bytesWritten,r=0;r<this.dirRecords.length;r++)this.push({data:this.dirRecords[r],meta:{percent:100}});var i=this.bytesWritten-e,s=Sr(this.dirRecords.length,i,e,this.zipComment,this.encodeFileName);this.push({data:s,meta:{percent:100}})}prepareNextSource(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()}registerPrevious(e){this._sources.push(e);var r=this;return e.on("data",function(i){r.processChunk(i)}),e.on("end",function(){r.closedSource(r.previous.streamInfo),r._sources.length?r.prepareNextSource():r.end()}),e.on("error",function(i){r.error(i)}),this}resume(){if(!f.prototype.resume.call(this))return!1;if(!this.previous&&this._sources.length)return this.prepareNextSource(),!0;if(!this.previous&&!this._sources.length&&!this.generatedError)return this.end(),!0}error(e){var r=this._sources;if(!f.prototype.error.call(this,e))return!1;for(var i=0;i<r.length;i++)try{r[i].error(e)}catch{}return!0}lock(){f.prototype.lock.call(this);for(var e=this._sources,r=0;r<e.length;r++)e[r].lock()}};var Er=function(t,e){var r=t||e,i=O[r];if(!i)throw new Error(r+" is not a valid compression method !");return i};function br(t,e,r){var i=new re(e.streamFiles,r,e.platform,e.encodeFileName),s=0;try{t.forEach(function(n,o){s++;var u=Er(o.options.compression,e.compression),h=o.options.compressionOptions||e.compressionOptions||{},l=o.dir,p=o.date;o._compressWorker(u,h).withStreamInfo("file",{name:n,dir:l,date:p,comment:o.comment||"",unixPermissions:o.unixPermissions,dosPermissions:o.dosPermissions}).pipe(i)}),i.entriesCount=s}catch(n){i.error(n)}return i}var Ie={generateWorker:br};var te=class extends f{constructor(e){super("ConvertWorker to "+e),this.destType=e}processChunk(e){this.push({data:a.transformTo(this.destType,e.data),meta:e.meta})}};function Ar(t,e,r){switch(t){case"blob":return a.newBlob(a.transformTo("arraybuffer",e),r);case"base64":return q.encode(e);default:return a.transformTo(t,e)}}function _r(t,e){var r,i=0,s=null,n=0;for(r=0;r<e.length;r++)n+=e[r].length;switch(t){case"string":return e.join("");case"array":return Array.prototype.concat.apply([],e);case"uint8array":for(s=new Uint8Array(n),r=0;r<e.length;r++)s.set(e[r],i),i+=e[r].length;return s;case"nodebuffer":return Buffer.concat(e);default:throw new Error("concat : unsupported type '"+t+"'")}}function kr(t,e){return new Promise(function(r,i){var s=[],n=t._internalType,o=t._outputType,u=t._mimeType;t.on("data",function(h,l){s.push(h),e&&e(l)}).on("error",function(h){s=[],i(h)}).on("end",function(){try{var h=Ar(o,_r(n,s),u);r(h)}catch(l){i(l)}s=[]}).resume()})}var R=class{constructor(e,r,i){var s=r;switch(r){case"blob":case"arraybuffer":s="uint8array";break;case"base64":s="string";break}try{this._internalType=s,this._outputType=r,this._mimeType=i,a.checkSupport(s),this._worker=e.pipe(new te(s)),e.lock()}catch(n){this._worker=new f("error"),this._worker.error(n)}}accumulate(e){return kr(this,e)}on(e,r){var i=this;return e==="data"?this._worker.on(e,function(s){r.call(i,s.data,s.meta)}):this._worker.on(e,function(){a.delay(r,arguments,i)}),this}resume(){return a.delay(this._worker.resume,[],this._worker),this}pause(){return this._worker.pause(),this}toNodejsStream(e){if(a.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new NodejsStreamOutputAdapter(this,{objectMode:this._outputType!=="nodebuffer"},e)}};var V={base64:!1,binary:!1,dir:!1,createFolders:!0,date:null,compression:null,compressionOptions:null,comment:null,unixPermissions:null,dosPermissions:null};var Ir=16*1024,F=class extends f{constructor(e){super("DataWorker");var r=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then(function(i){r.dataIsReady=!0,r.data=i,r.max=i&&i.length||0,r.type=a.getTypeOf(i),r.isPaused||r._tickAndRepeat()},function(i){r.error(i)})}cleanUp(){f.prototype.cleanUp.call(this),this.data=null}resume(){return f.prototype.resume.call(this)?(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,a.delay(this._tickAndRepeat,[],this)),!0):!1}_tickAndRepeat(){this._tickScheduled=!1,!(this.isPaused||this.isFinished)&&(this._tick(),this.isFinished||(a.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))}_tick(){if(this.isPaused||this.isFinished)return!1;var e=Ir,r=null,i=Math.min(this.max,this.index+e);if(this.index>=this.max)return this.end();switch(this.type){case"string":r=this.data.substring(this.index,i);break;case"uint8array":r=this.data.subarray(this.index,i);break;case"array":case"nodebuffer":r=this.data.slice(this.index,i);break}return this.index=i,this.push({data:r,meta:{percent:this.max?this.index/this.max*100:0}})}};var P=class extends f{constructor(){super("Crc32Probe"),this.withStreamInfo("crc32",0)}processChunk(e){this.streamInfo.crc32=_(e.data,this.streamInfo.crc32||0),this.push(e)}};var z=class extends f{constructor(e){super("DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}processChunk(e){if(e){var r=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=r+e.data.length}f.prototype.processChunk.call(this,e)}};var S=class{constructor(e,r,i,s,n){this.compressedSize=e,this.uncompressedSize=r,this.crc32=i,this.compression=s,this.compressedContent=n}getContentWorker(){var e=new F(Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new z("data_length")),r=this;return e.on("end",function(){if(this.streamInfo.data_length!==r.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),e}getCompressedWorker(){return new F(Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}static createWorkerFrom(e,r,i){return e.pipe(new P).pipe(new z("uncompressedSize")).pipe(r.compressWorker(i)).pipe(new z("compressedSize")).withStreamInfo("compression",r)}};var ie=class{constructor(e,r,i){this.name=e,this.dir=i.dir,this.date=i.date,this.comment=i.comment,this.unixPermissions=i.unixPermissions,this.dosPermissions=i.dosPermissions,this._data=r,this._dataBinary=i.binary,this.options={compression:i.compression,compressionOptions:i.compressionOptions}}internalStream(e){var r=null,i="string";try{if(!e)throw new Error("No output type specified.");i=e.toLowerCase();var s=i==="string"||i==="text";(i==="binarystring"||i==="text")&&(i="string"),r=this._decompressWorker();var n=!this._dataBinary;n&&!s&&(r=r.pipe(new x.Utf8EncodeWorker)),!n&&s&&(r=r.pipe(new x.Utf8DecodeWorker))}catch(o){r=new f("error"),r.error(o)}return new R(r,i,"")}async(e,r){return this.internalStream(e).accumulate(r)}nodeStream(e,r){return this.internalStream(e||"nodebuffer").toNodejsStream(r)}_compressWorker(e,r){if(this._data instanceof S&&this._data.compression.magic===e.magic)return this._data.getCompressedWorker();var i=this._decompressWorker();return this._dataBinary||(i=i.pipe(new x.Utf8EncodeWorker)),S.createWorkerFrom(i,e,r)}_decompressWorker(){return this._data instanceof S?this._data.getContentWorker():this._data instanceof f?this._data:new F(this._data)}};var se=class extends f{constructor(e,r){super("Nodejs stream input adapter for "+e),this._upstreamEnded=!1,this._bindStream(r)}_bindStream(e){var r=this;this._stream=e,e.pause(),e.on("data",function(i){r.push({data:i,meta:{percent:0}})}).on("error",function(i){r.isPaused?this.generatedError=i:r.error(i)}).on("end",function(){r.isPaused?r._upstreamEnded=!0:r.end()})}pause(){return f.prototype.pause.call(this)?(this._stream.pause(),!0):!1}resume(){return f.prototype.resume.call(this)?(this._upstreamEnded?this.end():this._stream.resume(),!0):!1}};var Fe=function(t,e,r){var i=a.getTypeOf(e),s,n=a.extend(r||{},V);n.date=n.date||new Date,n.compression!==null&&(n.compression=n.compression.toUpperCase()),typeof n.unixPermissions=="string"&&(n.unixPermissions=parseInt(n.unixPermissions,8)),n.unixPermissions&&n.unixPermissions&16384&&(n.dir=!0),n.dosPermissions&&n.dosPermissions&16&&(n.dir=!0),n.dir&&(t=Te(t)),n.createFolders&&(s=Or(t))&&De.call(this,s,!0);var o=i==="string"&&n.binary===!1&&n.base64===!1;(!r||typeof r.binary>"u")&&(n.binary=!o);var u=e instanceof S&&e.uncompressedSize===0;(u||n.dir||!e||e.length===0)&&(n.base64=!1,n.binary=!0,e="",n.compression="STORE",i="string");var h=null;e instanceof S||e instanceof f?h=e:y.isNode&&y.isStream(e)?h=new se(t,e):h=a.prepareContent(t,e,n.binary,n.optimizedBinaryString,n.base64);var l=new ie(t,h,n);this.files[t]=l},Or=function(t){t.slice(-1)==="/"&&(t=t.substring(0,t.length-1));var e=t.lastIndexOf("/");return e>0?t.substring(0,e):""},Te=function(t){return t.slice(-1)!=="/"&&(t+="/"),t},De=function(t,e){return e=typeof e<"u"?e:V.createFolders,t=Te(t),this.files[t]||Fe.call(this,t,null,{dir:!0,createFolders:e}),this.files[t]};function Oe(t){return Object.prototype.toString.call(t)==="[object RegExp]"}var G=class{forEach(e){var r,i,s;for(r in this.files)s=this.files[r],i=r.slice(this.root.length,r.length),i&&r.slice(0,this.root.length)===this.root&&e(i,s)}filter(e){var r=[];return this.forEach(function(i,s){e(i,s)&&r.push(s)}),r}file(e,r,i){if(arguments.length===1)if(Oe(e)){var s=e;return this.filter(function(o,u){return!u.dir&&s.test(o)})}else{var n=this.files[this.root+e];return n&&!n.dir?n:null}else e=this.root+e,Fe.call(this,e,r,i);return this}folder(e){if(!e)return this;if(Oe(e))return this.filter(function(n,o){return o.dir&&e.test(n)});var r=this.root+e,i=De.call(this,r),s=this.clone();return s.root=i.name,s}remove(e){e=this.root+e;var r=this.files[e];if(r||(e.slice(-1)!=="/"&&(e+="/"),r=this.files[e]),r&&!r.dir)delete this.files[e];else for(var i=this.filter(function(n,o){return o.name.slice(0,e.length)===e}),s=0;s<i.length;s++)delete this.files[i[s].name];return this}generate(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")}generateInternalStream(e){var r,i={};try{if(i=a.extend(e||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:x.utf8encode}),i.type=i.type.toLowerCase(),i.compression=i.compression.toUpperCase(),i.type==="binarystring"&&(i.type="string"),!i.type)throw new Error("No output type specified.");a.checkSupport(i.type),(i.platform==="darwin"||i.platform==="freebsd"||i.platform==="linux"||i.platform==="sunos")&&(i.platform="UNIX"),i.platform==="win32"&&(i.platform="DOS");var s=i.comment||this.comment||"";r=Ie.generateWorker(this,i,s)}catch(n){r=new f("error"),r.error(n)}return new R(r,i.type||"string",i.mimeType)}generateAsync(e,r){return this.generateInternalStream(e).accumulate(r)}generateNodeStream(e,r){return e=e||{},e.type||(e.type="nodebuffer"),this.generateInternalStream(e).toNodejsStream(r)}};var L=class{constructor(e){this.data=e,this.length=e.length,this.index=0,this.zero=0}checkOffset(e){this.checkIndex(this.index+e)}checkIndex(e){if(this.length<this.zero+e||e<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+e+"). Corrupted zip ?")}setIndex(e){this.checkIndex(e),this.index=e}skip(e){this.setIndex(this.index+e)}byteAt(){}readInt(e){var r=0,i;for(this.checkOffset(e),i=this.index+e-1;i>=this.index;i--)r=(r<<8)+this.byteAt(i);return this.index+=e,r}readString(e){return I("string",this.readData(e))}readData(){}lastIndexOfSignature(){}readAndCheckSignature(){}readDate(){var e=this.readInt(4);return new Date(Date.UTC((e>>25&127)+1980,(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(e&31)<<1))}};var U=class extends L{constructor(e){super(e);for(var r=0;r<this.data.length;r++)e[r]=e[r]&255}byteAt(e){return this.data[this.zero+e]}lastIndexOfSignature(e){for(var r=e.charCodeAt(0),i=e.charCodeAt(1),s=e.charCodeAt(2),n=e.charCodeAt(3),o=this.length-4;o>=0;--o)if(this.data[o]===r&&this.data[o+1]===i&&this.data[o+2]===s&&this.data[o+3]===n)return o-this.zero;return-1}readAndCheckSignature(e){var r=e.charCodeAt(0),i=e.charCodeAt(1),s=e.charCodeAt(2),n=e.charCodeAt(3),o=this.readData(4);return r===o[0]&&i===o[1]&&s===o[2]&&n===o[3]}readData(e){if(this.checkOffset(e),e===0)return[];var r=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,r}};var ne=class extends L{constructor(e){super(e)}byteAt(e){return this.data.charCodeAt(this.zero+e)}lastIndexOfSignature(e){return this.data.lastIndexOf(e)-this.zero}readAndCheckSignature(e){var r=this.readData(4);return e===r}readData(e){this.checkOffset(e);var r=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,r}};var N=class extends U{constructor(e){super(e)}readData(e){if(this.checkOffset(e),e===0)return new Uint8Array(0);var r=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,r}};var oe=class extends N{constructor(e){super(e)}readData(e){this.checkOffset(e);var r=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,r}};function W(t){var e=B(t);return H(e),e==="string"&&!c.uint8array?new ne(t):e==="nodebuffer"?new oe(t):c.uint8array?new N(I("uint8array",t)):new U(I("array",t))}var Fr=0,Tr=3,Dr=function(t){for(var e in O)if(Object.prototype.hasOwnProperty.call(O,e)&&O[e].magic===t)return O[e];return null},ae=class{constructor(e,r){this.options=e,this.loadOptions=r}isEncrypted(){return(this.bitFlag&1)===1}useUTF8(){return(this.bitFlag&2048)===2048}readLocalPart(e){var r,i;if(e.skip(22),this.fileNameLength=e.readInt(2),i=e.readInt(2),this.fileName=e.readData(this.fileNameLength),e.skip(i),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(r=Dr(this.compressionMethod),r===null)throw new Error("Corrupted zip : compression "+a.pretty(this.compressionMethod)+" unknown (inner file : "+a.transformTo("string",this.fileName)+")");this.decompressed=new S(this.compressedSize,this.uncompressedSize,this.crc32,r,e.readData(this.compressedSize))}readCentralPart(e){this.versionMadeBy=e.readInt(2),e.skip(2),this.bitFlag=e.readInt(2),this.compressionMethod=e.readString(2),this.date=e.readDate(),this.crc32=e.readInt(4),this.compressedSize=e.readInt(4),this.uncompressedSize=e.readInt(4);var r=e.readInt(2);if(this.extraFieldsLength=e.readInt(2),this.fileCommentLength=e.readInt(2),this.diskNumberStart=e.readInt(2),this.internalFileAttributes=e.readInt(2),this.externalFileAttributes=e.readInt(4),this.localHeaderOffset=e.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");e.skip(r),this.readExtraFields(e),this.parseZIP64ExtraField(e),this.fileComment=e.readData(this.fileCommentLength)}processAttributes(){this.unixPermissions=null,this.dosPermissions=null;var e=this.versionMadeBy>>8;this.dir=!!(this.externalFileAttributes&16),e===Fr&&(this.dosPermissions=this.externalFileAttributes&63),e===Tr&&(this.unixPermissions=this.externalFileAttributes>>16&65535),!this.dir&&this.fileNameStr.slice(-1)==="/"&&(this.dir=!0)}parseZIP64ExtraField(){if(this.extraFields[1]){var e=W(this.extraFields[1].value);this.uncompressedSize===a.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===a.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===a.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===a.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}}readExtraFields(e){var r=e.index+this.extraFieldsLength,i,s,n;for(this.extraFields||(this.extraFields={});e.index+4<r;)i=e.readInt(2),s=e.readInt(2),n=e.readData(s),this.extraFields[i]={id:i,length:s,value:n};e.setIndex(r)}handleUTF8(){var e=c.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=x.utf8decode(this.fileName),this.fileCommentStr=x.utf8decode(this.fileComment);else{var r=this.findExtraFieldUnicodePath();if(r!==null)this.fileNameStr=r;else{var i=a.transformTo(e,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(i)}var s=this.findExtraFieldUnicodeComment();if(s!==null)this.fileCommentStr=s;else{var n=a.transformTo(e,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(n)}}}findExtraFieldUnicodePath(){var e=this.extraFields[28789];if(e){var r=W(e.value);return r.readInt(1)!==1||_(this.fileName)!==r.readInt(4)?null:x.utf8decode(r.readData(e.length-5))}return null}findExtraFieldUnicodeComment(){var e=this.extraFields[25461];if(e){var r=W(e.value);return r.readInt(1)!==1||_(this.fileComment)!==r.readInt(4)?null:x.utf8decode(r.readData(e.length-5))}return null}};var fe=class{constructor(e){this.files=[],this.loadOptions=e}checkSignature(e){if(!this.reader.readAndCheckSignature(e)){this.reader.index-=4;var r=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+a.pretty(r)+", expected "+a.pretty(e)+")")}}isSignature(e,r){var i=this.reader.index;this.reader.setIndex(e);var s=this.reader.readString(4),n=s===r;return this.reader.setIndex(i),n}readBlockEndOfCentral(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var e=this.reader.readData(this.zipCommentLength),r=c.uint8array?"uint8array":"array",i=a.transformTo(r,e);this.zipComment=this.loadOptions.decodeFileName(i)}readBlockZip64EndOfCentral(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var e=this.zip64EndOfCentralSize-44,r=0,i,s,n;r<e;)i=this.reader.readInt(2),s=this.reader.readInt(4),n=this.reader.readData(s),this.zip64ExtensibleData[i]={id:i,length:s,value:n}}readBlockZip64EndOfCentralLocator(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),this.disksCount>1)throw new Error("Multi-volumes zip are not supported")}readLocalFiles(){var e,r;for(e=0;e<this.files.length;e++)r=this.files[e],this.reader.setIndex(r.localHeaderOffset),this.checkSignature(g.LOCAL_FILE_HEADER),r.readLocalPart(this.reader),r.handleUTF8(),r.processAttributes()}readCentralDir(){var e;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(g.CENTRAL_FILE_HEADER);)e=new ae({zip64:this.zip64},this.loadOptions),e.readCentralPart(this.reader),this.files.push(e);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)}readEndOfCentral(){var e=this.reader.lastIndexOfSignature(g.CENTRAL_DIRECTORY_END);if(e<0){var r=!this.isSignature(0,g.LOCAL_FILE_HEADER);throw r?new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html"):new Error("Corrupted zip: can't find end of central directory")}this.reader.setIndex(e);var i=e;if(this.checkSignature(g.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===a.MAX_VALUE_16BITS||this.diskWithCentralDirStart===a.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===a.MAX_VALUE_16BITS||this.centralDirRecords===a.MAX_VALUE_16BITS||this.centralDirSize===a.MAX_VALUE_32BITS||this.centralDirOffset===a.MAX_VALUE_32BITS){if(this.zip64=!0,e=this.reader.lastIndexOfSignature(g.ZIP64_CENTRAL_DIRECTORY_LOCATOR),e<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(e),this.checkSignature(g.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,g.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(g.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(g.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var s=this.centralDirOffset+this.centralDirSize;this.zip64&&(s+=20,s+=12+this.zip64EndOfCentralSize);var n=i-s;if(n>0)this.isSignature(i,g.CENTRAL_FILE_HEADER)||(this.reader.zero=n);else if(n<0)throw new Error("Corrupted zip: missing "+Math.abs(n)+" bytes.")}prepareReader(e){this.reader=W(e)}load(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}};function Br(t){return new Promise(function(e,r){var i=t.decompressed.getContentWorker().pipe(new P);i.on("error",function(s){r(s)}).on("end",function(){i.streamInfo.crc32!==t.decompressed.crc32?r(new Error("Corrupted zip : CRC32 mismatch")):e()}).resume()})}function Be(t,e,r){return r=a.extend(r||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:x.utf8decode}),y.isNode&&y.isStream(e)?Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):a.prepareContent("the loaded zip file",e,!0,r.optimizedBinaryString,r.base64).then(function(i){var s=new fe(r);return s.load(i),s}).then(function(s){var n=[Promise.resolve(s)],o=s.files;if(r.checkCRC32)for(var u=0;u<o.length;u++)n.push(Br(o[u]));return Promise.all(n)}).then(function(s){for(var n=s.shift(),o=n.files,u=0;u<o.length;u++){var h=o[u],l=h.fileNameStr,p=a.resolve(h.fileNameStr);t.file(p,h.decompressed,{binary:!0,optimizedBinaryString:!0,date:h.date,dir:h.dir,comment:h.fileCommentStr.length?h.fileCommentStr:null,unixPermissions:h.unixPermissions,dosPermissions:h.dosPermissions,createFolders:r.createFolders}),h.dir||(t.file(p).unsafeOriginalName=l)}return n.zipComment.length&&(t.comment=n.zipComment),t})}var Re=class t extends G{constructor(){if(super(),!(this instanceof t))return new t;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var e=new t;for(var r in this)typeof this[r]!="function"&&(e[r]=this[r]);return e}}static support=c;static defaults=V;static version="4.1.1";loadAsync(e,r){return Be(this,e,r)}static loadAsync(e,r){return new t().loadAsync(e,r)}};export{Re as JSZip}; |
+6
-2
| { | ||
| "name": "@node-projects/jszip", | ||
| "version": "4.1.1", | ||
| "version": "4.1.2", | ||
| "author": "Stuart Knightley <stuart@stuartk.com>", | ||
@@ -14,3 +14,6 @@ "description": "Create, read and edit .zip files with JavaScript http://stuartk.com/jszip", | ||
| "lint": "eslint .", | ||
| "start": "web-dev-server --open" | ||
| "start": "web-dev-server --open", | ||
| "prepublishOnly": "npm run bundle", | ||
| "bundle": "esbuild ./lib/index.js --format=esm --minify --external:pako --platform=neutral --bundle --outfile=./dist/index-min.js" | ||
| }, | ||
@@ -46,2 +49,3 @@ "contributors": [ | ||
| "browserify": "~13.0.0", | ||
| "esbuild": "^0.25.10", | ||
| "eslint": "^8.18.0", | ||
@@ -48,0 +52,0 @@ "grunt": "~0.4.1", |
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
234479
19.84%41
2.5%4138
3.74%16
6.67%2
100%14
27.27%