Skip to content

Commit

Permalink
Bugfix z-worker base path
Browse files Browse the repository at this point in the history
  • Loading branch information
Avaer Kazmer committed Nov 4, 2019
1 parent 35b17e3 commit 3744bda
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions zip.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

const basePath = import.meta.url.replace(/[^\/]*$/, '');

(function(obj) {
"use strict";

Expand Down Expand Up @@ -870,8 +872,8 @@
}

var DEFAULT_WORKER_SCRIPTS = {
deflater: ['z-worker.js', 'deflate.js'],
inflater: ['z-worker.js', 'inflate.js']
deflater: [basePath + 'z-worker.js', basePath + 'deflate.js'],
inflater: [basePath + 'z-worker.js', basePath + 'inflate.js']
};
function createWorker(type, callback, onerror) {
if (obj.zip.workerScripts !== null && obj.zip.workerScriptsPath !== null) {
Expand Down

0 comments on commit 3744bda

Please sign in to comment.