src/webworker/archive-reader.js
/**
     * get archive entries
     * @param {boolean} skipExtraction
     */
get archive entries
@param {boolean} skipExtraction
get archive entries @param { boolean } skipExtraction
*entries(skipExtraction = false){
        this._archive = this._runCode.openArchive( this._filePtr, this._fileLength );
        let entry;
        while( true ){
            entry = this._runCode.getNextEntry(this._archive);
            if( entry === 0 ) break;
            const entryData = {
                size: this._runCode.getEntrySize(entry),
                path: this._runCode.getEntryName(entry),
                type: TYPE_MAP[this._runCode.getEntryType(entry)]
            };
            if( skipExtraction ){
                this._runCode.skipEntry(this._archive);
            }else{
                const ptr = this._runCode.getFileData(this._archive,entryData.size);
                if( ptr < 0 ){
                    throw new Error(this._runCode.getError(this._archive));
                }
                const data = this._wasmModule.HEAP8.slice(ptr,ptr+entryData.size);
                this._wasmModule._free(ptr);
                if( entryData.type === 'FILE' ){
                    let fileName = entryData.path.split('/');
                    fileName = fileName[fileName.length - 1];
                    entryData.file = new File([data], fileName, {
                        type: 'application/octet-stream'
                    });
                }
            }
            yield entryData;
        }
    }
* entries ( skipExtraction = false ) { this . _archive = this . _runCode . openArchive ( this . _filePtr , this . _fileLength ) ; let entry ; while ( true ) { entry = this . _runCode . getNextEntry ( this . _archive ) ; if ( entry === 0 ) break ; const entryData = { size : this . _runCode . getEntrySize ( entry ) , path : this . _runCode . getEntryName ( entry ) , type : TYPE_MAP [ this . _runCode . getEntryType ( entry ) ] } ; if ( skipExtraction ) { this . _runCode . skipEntry ( this . _archive ) ; } else { const ptr = this . _runCode . getFileData ( this . _archive , entryData . size ) ; if ( ptr < 0 ) { throw new Error ( this . _runCode . getError ( this . _archive ) ) ; } const data = this . _wasmModule . HEAP8 . slice ( ptr , ptr + entryData . size ) ; this . _wasmModule . _free ( ptr ) ; if ( entryData . type === 'FILE' ) { let fileName = entryData . path . split ( '/' ) ; fileName = fileName [ fileName . length - 1 ] ; entryData . file = new File ( [ data ] , fileName , { type : 'application/octet-stream' } ) ; } } yield entryData ; } }
get archive entries
 @param {boolean} skipExtraction
get archive entries @param { boolean } skipExtraction