99 * Copyright(c) 2021 Google Inc.
1010 */
1111
12+ // TODO(bitjs): Consider moving all this back into decompress.js to simplify the code now that
13+ // the implementation isn't tied to Web Workers so heavily.
14+
1215import { UnarchiveAppendEvent , UnarchiveErrorEvent , UnarchiveEvent , UnarchiveEventType ,
1316 UnarchiveExtractEvent , UnarchiveFinishEvent , UnarchiveInfoEvent ,
1417 UnarchiveProgressEvent , UnarchiveStartEvent } from './events.js' ;
@@ -20,11 +23,12 @@ import { findMimeType } from '../file/sniffer.js';
2023 * @property {Uint8Array } fileData
2124 */
2225
26+ // TODO: Remove pathToBitJS completely from this.
27+
2328/**
2429 * @typedef UnarchiverOptions
2530 * @property {string } pathToBitJS The path to the bitjs folder.
2631 * @property {boolean= } debug Set to true for verbose unarchiver logging.
27- * @property {ThreadingMode= } threadingMode The default is WEB_WORKER.
2832 */
2933
3034/**
@@ -72,13 +76,6 @@ export class Unarchiver extends EventTarget {
7276 */
7377 this . connectPortFn_ = connectPortFn ;
7478
75- /**
76- * The path to the BitJS files.
77- * @type {string }
78- * @private
79- */
80- this . pathToBitJS_ = options . pathToBitJS || '/' ;
81-
8279 /**
8380 * @orivate
8481 * @type {boolean }
@@ -160,8 +157,7 @@ export class Unarchiver extends EventTarget {
160157 const me = this ;
161158 const messageChannel = new MessageChannel ( ) ;
162159 this . port_ = messageChannel . port1 ;
163- this . connectPortFn_ ( this . pathToBitJS_ ,
164- this . getScriptFileName ( ) , messageChannel . port2 ) . then ( ( ) => {
160+ this . connectPortFn_ ( this . getScriptFileName ( ) , messageChannel . port2 ) . then ( ( ) => {
165161 this . port_ . onerror = function ( e ) {
166162 console . log ( 'Impl error: message = ' + e . message ) ;
167163 throw e ;
0 commit comments