@loaders.gl/zip
Advanced tools
Comparing version 4.0.0-alpha.21 to 4.0.0-alpha.22
@@ -18,2 +18,3 @@ "use strict"; | ||
var _localFileHeader = require("../parse-zip/local-file-header"); | ||
var _compression = require("@loaders.gl/compression"); | ||
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | ||
@@ -40,2 +41,27 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | ||
return _; | ||
}(), | ||
8: function () { | ||
var _3 = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee2(compressedFile) { | ||
var compression, decompressedData; | ||
return _regenerator.default.wrap(function _callee2$(_context2) { | ||
while (1) switch (_context2.prev = _context2.next) { | ||
case 0: | ||
compression = new _compression.DeflateCompression({ | ||
raw: true | ||
}); | ||
_context2.next = 3; | ||
return compression.decompress(compressedFile); | ||
case 3: | ||
decompressedData = _context2.sent; | ||
return _context2.abrupt("return", decompressedData); | ||
case 5: | ||
case "end": | ||
return _context2.stop(); | ||
} | ||
}, _callee2); | ||
})); | ||
function _(_x2) { | ||
return _3.apply(this, arguments); | ||
} | ||
return _; | ||
}() | ||
@@ -47,3 +73,5 @@ }; | ||
(0, _defineProperty2.default)(this, "fileProvider", Promise.resolve(null)); | ||
(0, _defineProperty2.default)(this, "fileName", void 0); | ||
if (typeof file === 'string') { | ||
this.fileName = file; | ||
if (!_core.isBrowser) { | ||
@@ -61,19 +89,22 @@ this.fileProvider = _fileHandleFile.FileHandleFile.from(file); | ||
value: function () { | ||
var _destroy = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee2() { | ||
var _destroy = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee3() { | ||
var fileProvider; | ||
return _regenerator.default.wrap(function _callee2$(_context2) { | ||
while (1) switch (_context2.prev = _context2.next) { | ||
return _regenerator.default.wrap(function _callee3$(_context3) { | ||
while (1) switch (_context3.prev = _context3.next) { | ||
case 0: | ||
_context2.next = 2; | ||
_context3.next = 2; | ||
return this.fileProvider; | ||
case 2: | ||
fileProvider = _context2.sent; | ||
if (fileProvider) { | ||
fileProvider.destroy(); | ||
fileProvider = _context3.sent; | ||
if (!fileProvider) { | ||
_context3.next = 6; | ||
break; | ||
} | ||
case 4: | ||
_context3.next = 6; | ||
return fileProvider.destroy(); | ||
case 6: | ||
case "end": | ||
return _context2.stop(); | ||
return _context3.stop(); | ||
} | ||
}, _callee2, this); | ||
}, _callee3, this); | ||
})); | ||
@@ -88,13 +119,13 @@ function destroy() { | ||
value: function () { | ||
var _readdir = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee3() { | ||
var _readdir = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee4() { | ||
var fileProvider, fileNames, zipCDIterator, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, cdHeader; | ||
return _regenerator.default.wrap(function _callee3$(_context3) { | ||
while (1) switch (_context3.prev = _context3.next) { | ||
return _regenerator.default.wrap(function _callee4$(_context4) { | ||
while (1) switch (_context4.prev = _context4.next) { | ||
case 0: | ||
_context3.next = 2; | ||
_context4.next = 2; | ||
return this.fileProvider; | ||
case 2: | ||
fileProvider = _context3.sent; | ||
fileProvider = _context4.sent; | ||
if (fileProvider) { | ||
_context3.next = 5; | ||
_context4.next = 5; | ||
break; | ||
@@ -108,10 +139,10 @@ } | ||
_didIteratorError = false; | ||
_context3.prev = 9; | ||
_context4.prev = 9; | ||
_iterator = _asyncIterator(zipCDIterator); | ||
case 11: | ||
_context3.next = 13; | ||
_context4.next = 13; | ||
return _iterator.next(); | ||
case 13: | ||
if (!(_iteratorAbruptCompletion = !(_step = _context3.sent).done)) { | ||
_context3.next = 19; | ||
if (!(_iteratorAbruptCompletion = !(_step = _context4.sent).done)) { | ||
_context4.next = 19; | ||
break; | ||
@@ -123,25 +154,25 @@ } | ||
_iteratorAbruptCompletion = false; | ||
_context3.next = 11; | ||
_context4.next = 11; | ||
break; | ||
case 19: | ||
_context3.next = 25; | ||
_context4.next = 25; | ||
break; | ||
case 21: | ||
_context3.prev = 21; | ||
_context3.t0 = _context3["catch"](9); | ||
_context4.prev = 21; | ||
_context4.t0 = _context4["catch"](9); | ||
_didIteratorError = true; | ||
_iteratorError = _context3.t0; | ||
_iteratorError = _context4.t0; | ||
case 25: | ||
_context3.prev = 25; | ||
_context3.prev = 26; | ||
_context4.prev = 25; | ||
_context4.prev = 26; | ||
if (!(_iteratorAbruptCompletion && _iterator.return != null)) { | ||
_context3.next = 30; | ||
_context4.next = 30; | ||
break; | ||
} | ||
_context3.next = 30; | ||
_context4.next = 30; | ||
return _iterator.return(); | ||
case 30: | ||
_context3.prev = 30; | ||
_context4.prev = 30; | ||
if (!_didIteratorError) { | ||
_context3.next = 33; | ||
_context4.next = 33; | ||
break; | ||
@@ -151,12 +182,12 @@ } | ||
case 33: | ||
return _context3.finish(30); | ||
return _context4.finish(30); | ||
case 34: | ||
return _context3.finish(25); | ||
return _context4.finish(25); | ||
case 35: | ||
return _context3.abrupt("return", fileNames); | ||
return _context4.abrupt("return", fileNames); | ||
case 36: | ||
case "end": | ||
return _context3.stop(); | ||
return _context4.stop(); | ||
} | ||
}, _callee3, this, [[9, 21, 25, 35], [26,, 30, 34]]); | ||
}, _callee4, this, [[9, 21, 25, 35], [26,, 30, 34]]); | ||
})); | ||
@@ -171,12 +202,12 @@ function readdir() { | ||
value: function () { | ||
var _stat = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee4(filename) { | ||
var _stat = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee5(filename) { | ||
var cdFileHeader; | ||
return _regenerator.default.wrap(function _callee4$(_context4) { | ||
while (1) switch (_context4.prev = _context4.next) { | ||
return _regenerator.default.wrap(function _callee5$(_context5) { | ||
while (1) switch (_context5.prev = _context5.next) { | ||
case 0: | ||
_context4.next = 2; | ||
_context5.next = 2; | ||
return this.getCDFileHeader(filename); | ||
case 2: | ||
cdFileHeader = _context4.sent; | ||
return _context4.abrupt("return", _objectSpread(_objectSpread({}, cdFileHeader), {}, { | ||
cdFileHeader = _context5.sent; | ||
return _context5.abrupt("return", _objectSpread(_objectSpread({}, cdFileHeader), {}, { | ||
size: Number(cdFileHeader.uncompressedSize) | ||
@@ -186,7 +217,7 @@ })); | ||
case "end": | ||
return _context4.stop(); | ||
return _context5.stop(); | ||
} | ||
}, _callee4, this); | ||
}, _callee5, this); | ||
})); | ||
function stat(_x2) { | ||
function stat(_x3) { | ||
return _stat.apply(this, arguments); | ||
@@ -199,13 +230,13 @@ } | ||
value: function () { | ||
var _fetch = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee5(filename) { | ||
var _fetch = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee6(filename) { | ||
var fileProvider, cdFileHeader, localFileHeader, compressionHandler, compressedFile, uncompressedFile, response; | ||
return _regenerator.default.wrap(function _callee5$(_context5) { | ||
while (1) switch (_context5.prev = _context5.next) { | ||
return _regenerator.default.wrap(function _callee6$(_context6) { | ||
while (1) switch (_context6.prev = _context6.next) { | ||
case 0: | ||
_context5.next = 2; | ||
_context6.next = 2; | ||
return this.fileProvider; | ||
case 2: | ||
fileProvider = _context5.sent; | ||
fileProvider = _context6.sent; | ||
if (fileProvider) { | ||
_context5.next = 5; | ||
_context6.next = 5; | ||
break; | ||
@@ -215,12 +246,12 @@ } | ||
case 5: | ||
_context5.next = 7; | ||
_context6.next = 7; | ||
return this.getCDFileHeader(filename); | ||
case 7: | ||
cdFileHeader = _context5.sent; | ||
_context5.next = 10; | ||
cdFileHeader = _context6.sent; | ||
_context6.next = 10; | ||
return (0, _localFileHeader.parseZipLocalFileHeader)(cdFileHeader.localHeaderOffset, fileProvider); | ||
case 10: | ||
localFileHeader = _context5.sent; | ||
localFileHeader = _context6.sent; | ||
if (localFileHeader) { | ||
_context5.next = 13; | ||
_context6.next = 13; | ||
break; | ||
@@ -232,3 +263,3 @@ } | ||
if (compressionHandler) { | ||
_context5.next = 16; | ||
_context6.next = 16; | ||
break; | ||
@@ -238,19 +269,22 @@ } | ||
case 16: | ||
_context5.next = 18; | ||
_context6.next = 18; | ||
return fileProvider.slice(localFileHeader.fileDataOffset, localFileHeader.fileDataOffset + localFileHeader.compressedSize); | ||
case 18: | ||
compressedFile = _context5.sent; | ||
_context5.next = 21; | ||
compressedFile = _context6.sent; | ||
_context6.next = 21; | ||
return compressionHandler(compressedFile); | ||
case 21: | ||
uncompressedFile = _context5.sent; | ||
uncompressedFile = _context6.sent; | ||
response = new Response(uncompressedFile); | ||
return _context5.abrupt("return", response); | ||
case 24: | ||
Object.defineProperty(response, 'url', { | ||
value: "".concat(this.fileName || '', "/").concat(filename) | ||
}); | ||
return _context6.abrupt("return", response); | ||
case 25: | ||
case "end": | ||
return _context5.stop(); | ||
return _context6.stop(); | ||
} | ||
}, _callee5, this); | ||
}, _callee6, this); | ||
})); | ||
function fetch(_x3) { | ||
function fetch(_x4) { | ||
return _fetch.apply(this, arguments); | ||
@@ -263,13 +297,13 @@ } | ||
value: function () { | ||
var _getCDFileHeader = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee6(filename) { | ||
var _getCDFileHeader = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee7(filename) { | ||
var fileProvider, zipCDIterator, result, _iteratorAbruptCompletion2, _didIteratorError2, _iteratorError2, _iterator2, _step2, cdHeader; | ||
return _regenerator.default.wrap(function _callee6$(_context6) { | ||
while (1) switch (_context6.prev = _context6.next) { | ||
return _regenerator.default.wrap(function _callee7$(_context7) { | ||
while (1) switch (_context7.prev = _context7.next) { | ||
case 0: | ||
_context6.next = 2; | ||
_context7.next = 2; | ||
return this.fileProvider; | ||
case 2: | ||
fileProvider = _context6.sent; | ||
fileProvider = _context7.sent; | ||
if (fileProvider) { | ||
_context6.next = 5; | ||
_context7.next = 5; | ||
break; | ||
@@ -283,10 +317,10 @@ } | ||
_didIteratorError2 = false; | ||
_context6.prev = 9; | ||
_context7.prev = 9; | ||
_iterator2 = _asyncIterator(zipCDIterator); | ||
case 11: | ||
_context6.next = 13; | ||
_context7.next = 13; | ||
return _iterator2.next(); | ||
case 13: | ||
if (!(_iteratorAbruptCompletion2 = !(_step2 = _context6.sent).done)) { | ||
_context6.next = 21; | ||
if (!(_iteratorAbruptCompletion2 = !(_step2 = _context7.sent).done)) { | ||
_context7.next = 21; | ||
break; | ||
@@ -296,32 +330,32 @@ } | ||
if (!(cdHeader.fileName === filename)) { | ||
_context6.next = 18; | ||
_context7.next = 18; | ||
break; | ||
} | ||
result = cdHeader; | ||
return _context6.abrupt("break", 21); | ||
return _context7.abrupt("break", 21); | ||
case 18: | ||
_iteratorAbruptCompletion2 = false; | ||
_context6.next = 11; | ||
_context7.next = 11; | ||
break; | ||
case 21: | ||
_context6.next = 27; | ||
_context7.next = 27; | ||
break; | ||
case 23: | ||
_context6.prev = 23; | ||
_context6.t0 = _context6["catch"](9); | ||
_context7.prev = 23; | ||
_context7.t0 = _context7["catch"](9); | ||
_didIteratorError2 = true; | ||
_iteratorError2 = _context6.t0; | ||
_iteratorError2 = _context7.t0; | ||
case 27: | ||
_context6.prev = 27; | ||
_context6.prev = 28; | ||
_context7.prev = 27; | ||
_context7.prev = 28; | ||
if (!(_iteratorAbruptCompletion2 && _iterator2.return != null)) { | ||
_context6.next = 32; | ||
_context7.next = 32; | ||
break; | ||
} | ||
_context6.next = 32; | ||
_context7.next = 32; | ||
return _iterator2.return(); | ||
case 32: | ||
_context6.prev = 32; | ||
_context7.prev = 32; | ||
if (!_didIteratorError2) { | ||
_context6.next = 35; | ||
_context7.next = 35; | ||
break; | ||
@@ -331,8 +365,8 @@ } | ||
case 35: | ||
return _context6.finish(32); | ||
return _context7.finish(32); | ||
case 36: | ||
return _context6.finish(27); | ||
return _context7.finish(27); | ||
case 37: | ||
if (result) { | ||
_context6.next = 39; | ||
_context7.next = 39; | ||
break; | ||
@@ -342,10 +376,10 @@ } | ||
case 39: | ||
return _context6.abrupt("return", result); | ||
return _context7.abrupt("return", result); | ||
case 40: | ||
case "end": | ||
return _context6.stop(); | ||
return _context7.stop(); | ||
} | ||
}, _callee6, this, [[9, 23, 27, 37], [28,, 32, 36]]); | ||
}, _callee7, this, [[9, 23, 27, 37], [28,, 32, 36]]); | ||
})); | ||
function getCDFileHeader(_x4) { | ||
function getCDFileHeader(_x5) { | ||
return _getCDFileHeader.apply(this, arguments); | ||
@@ -352,0 +386,0 @@ } |
@@ -25,2 +25,8 @@ "use strict"; | ||
}); | ||
Object.defineProperty(exports, "ZipFileSystem", { | ||
enumerable: true, | ||
get: function get() { | ||
return _zipFilesystem.ZipFileSystem; | ||
} | ||
}); | ||
Object.defineProperty(exports, "ZipLoader", { | ||
@@ -114,2 +120,3 @@ enumerable: true, | ||
var _hashFileUtility = require("./hash-file-utility"); | ||
var _zipFilesystem = require("./filesystems/zip-filesystem"); | ||
//# sourceMappingURL=index.js.map |
@@ -11,3 +11,3 @@ "use strict"; | ||
var _jszip = _interopRequireDefault(require("jszip")); | ||
var VERSION = typeof "4.0.0-alpha.21" !== 'undefined' ? "4.0.0-alpha.21" : 'latest'; | ||
var VERSION = typeof "4.0.0-alpha.22" !== 'undefined' ? "4.0.0-alpha.22" : 'latest'; | ||
var ZipLoader = { | ||
@@ -14,0 +14,0 @@ id: 'zip', |
@@ -7,4 +7,12 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
import { parseZipLocalFileHeader } from '../parse-zip/local-file-header'; | ||
import { DeflateCompression } from '@loaders.gl/compression'; | ||
const COMPRESSION_METHODS = { | ||
0: async compressedFile => compressedFile | ||
0: async compressedFile => compressedFile, | ||
8: async compressedFile => { | ||
const compression = new DeflateCompression({ | ||
raw: true | ||
}); | ||
const decompressedData = await compression.decompress(compressedFile); | ||
return decompressedData; | ||
} | ||
}; | ||
@@ -14,3 +22,5 @@ export class ZipFileSystem { | ||
_defineProperty(this, "fileProvider", Promise.resolve(null)); | ||
_defineProperty(this, "fileName", void 0); | ||
if (typeof file === 'string') { | ||
this.fileName = file; | ||
if (!isBrowser) { | ||
@@ -28,3 +38,3 @@ this.fileProvider = FileHandleFile.from(file); | ||
if (fileProvider) { | ||
fileProvider.destroy(); | ||
await fileProvider.destroy(); | ||
} | ||
@@ -68,2 +78,5 @@ } | ||
const response = new Response(uncompressedFile); | ||
Object.defineProperty(response, 'url', { | ||
value: "".concat(this.fileName || '', "/").concat(filename) | ||
}); | ||
return response; | ||
@@ -70,0 +83,0 @@ } |
@@ -11,2 +11,3 @@ export { ZipLoader } from './zip-loader'; | ||
export { compareHashes, parseHashFile, findBin, generateHashInfo } from './hash-file-utility'; | ||
export { ZipFileSystem } from './filesystems/zip-filesystem'; | ||
//# sourceMappingURL=index.js.map |
import JSZip from 'jszip'; | ||
const VERSION = typeof "4.0.0-alpha.21" !== 'undefined' ? "4.0.0-alpha.21" : 'latest'; | ||
const VERSION = typeof "4.0.0-alpha.22" !== 'undefined' ? "4.0.0-alpha.22" : 'latest'; | ||
export const ZipLoader = { | ||
@@ -4,0 +4,0 @@ id: 'zip', |
@@ -10,3 +10,4 @@ import { FileSystem } from '@loaders.gl/core'; | ||
/** FileProvider instance promise */ | ||
private fileProvider; | ||
protected fileProvider: Promise<FileProvider | null>; | ||
fileName?: string; | ||
/** | ||
@@ -13,0 +14,0 @@ * Constructor |
@@ -9,6 +9,13 @@ "use strict"; | ||
const local_file_header_1 = require("../parse-zip/local-file-header"); | ||
const compression_1 = require("@loaders.gl/compression"); | ||
/** Handling different compression types in zip */ | ||
const COMPRESSION_METHODS = { | ||
/** No compression */ | ||
0: async (compressedFile) => compressedFile | ||
0: async (compressedFile) => compressedFile, | ||
/** Deflation */ | ||
8: async (compressedFile) => { | ||
const compression = new compression_1.DeflateCompression({ raw: true }); | ||
const decompressedData = await compression.decompress(compressedFile); | ||
return decompressedData; | ||
} | ||
}; | ||
@@ -29,2 +36,3 @@ /** | ||
if (typeof file === 'string') { | ||
this.fileName = file; | ||
if (!core_1.isBrowser) { | ||
@@ -45,3 +53,3 @@ this.fileProvider = file_handle_file_1.FileHandleFile.from(file); | ||
if (fileProvider) { | ||
fileProvider.destroy(); | ||
await fileProvider.destroy(); | ||
} | ||
@@ -96,2 +104,3 @@ } | ||
const response = new Response(uncompressedFile); | ||
Object.defineProperty(response, 'url', { value: `${this.fileName || ''}/${filename}` }); | ||
return response; | ||
@@ -98,0 +107,0 @@ } |
@@ -13,2 +13,3 @@ export { ZipLoader } from './zip-loader'; | ||
export { compareHashes, parseHashFile, findBin, generateHashInfo } from './hash-file-utility'; | ||
export { ZipFileSystem } from './filesystems/zip-filesystem'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -6,3 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.generateHashInfo = exports.findBin = exports.parseHashFile = exports.compareHashes = exports.searchFromTheEnd = exports.parseEoCDRecord = exports.localHeaderSignature = exports.parseZipLocalFileHeader = exports.cdSignature = exports.zipCDFileHeaderGenerator = exports.parseZipCDFileHeader = exports.DataViewFile = exports.FileHandleFile = exports.TarBuilder = exports.ZipWriter = exports.ZipLoader = void 0; | ||
exports.ZipFileSystem = exports.generateHashInfo = exports.findBin = exports.parseHashFile = exports.compareHashes = exports.searchFromTheEnd = exports.parseEoCDRecord = exports.localHeaderSignature = exports.parseZipLocalFileHeader = exports.cdSignature = exports.zipCDFileHeaderGenerator = exports.parseZipCDFileHeader = exports.DataViewFile = exports.FileHandleFile = exports.TarBuilder = exports.ZipWriter = exports.ZipLoader = void 0; | ||
var zip_loader_1 = require("./zip-loader"); | ||
@@ -34,1 +34,3 @@ Object.defineProperty(exports, "ZipLoader", { enumerable: true, get: function () { return zip_loader_1.ZipLoader; } }); | ||
Object.defineProperty(exports, "generateHashInfo", { enumerable: true, get: function () { return hash_file_utility_1.generateHashInfo; } }); | ||
var zip_filesystem_1 = require("./filesystems/zip-filesystem"); | ||
Object.defineProperty(exports, "ZipFileSystem", { enumerable: true, get: function () { return zip_filesystem_1.ZipFileSystem; } }); |
{ | ||
"name": "@loaders.gl/zip", | ||
"version": "4.0.0-alpha.21", | ||
"version": "4.0.0-alpha.22", | ||
"description": "Zip Archive Loader", | ||
@@ -36,9 +36,9 @@ "license": "MIT", | ||
"dependencies": { | ||
"@loaders.gl/compression": "4.0.0-alpha.21", | ||
"@loaders.gl/compression": "4.0.0-alpha.22", | ||
"jszip": "^3.1.5" | ||
}, | ||
"peerDependencies": { | ||
"@loaders.gl/core": "^4.0.0" | ||
"@loaders.gl/core": "^4.0.0-alpha.21" | ||
}, | ||
"gitHead": "df5d670b136192b26941396e944f9c46be788e83" | ||
"gitHead": "0da838c506d1275383f2fd3d244d9c72b25397d2" | ||
} |
@@ -6,2 +6,3 @@ import {FileSystem, isBrowser} from '@loaders.gl/core'; | ||
import {parseZipLocalFileHeader} from '../parse-zip/local-file-header'; | ||
import {DeflateCompression} from '@loaders.gl/compression'; | ||
@@ -12,3 +13,9 @@ type CompressionHandler = (compressedFile: ArrayBuffer) => Promise<ArrayBuffer>; | ||
/** No compression */ | ||
0: async (compressedFile) => compressedFile | ||
0: async (compressedFile) => compressedFile, | ||
/** Deflation */ | ||
8: async (compressedFile) => { | ||
const compression = new DeflateCompression({raw: true}); | ||
const decompressedData = await compression.decompress(compressedFile); | ||
return decompressedData; | ||
} | ||
}; | ||
@@ -22,3 +29,4 @@ | ||
/** FileProvider instance promise */ | ||
private fileProvider: Promise<FileProvider | null> = Promise.resolve(null); | ||
protected fileProvider: Promise<FileProvider | null> = Promise.resolve(null); | ||
public fileName?: string; | ||
@@ -32,2 +40,3 @@ /** | ||
if (typeof file === 'string') { | ||
this.fileName = file; | ||
if (!isBrowser) { | ||
@@ -47,3 +56,3 @@ this.fileProvider = FileHandleFile.from(file); | ||
if (fileProvider) { | ||
fileProvider.destroy(); | ||
await fileProvider.destroy(); | ||
} | ||
@@ -111,2 +120,3 @@ } | ||
const response = new Response(uncompressedFile); | ||
Object.defineProperty(response, 'url', {value: `${this.fileName || ''}/${filename}`}); | ||
return response; | ||
@@ -113,0 +123,0 @@ } |
@@ -23,1 +23,3 @@ export {ZipLoader} from './zip-loader'; | ||
export {compareHashes, parseHashFile, findBin, generateHashInfo} from './hash-file-utility'; | ||
export {ZipFileSystem} from './filesystems/zip-filesystem'; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
764062
13732
+ Added@loaders.gl/compression@4.0.0-alpha.22(transitive)
+ Added@loaders.gl/loader-utils@4.0.0-alpha.22(transitive)
+ Added@loaders.gl/worker-utils@4.0.0-alpha.22(transitive)
- Removed@loaders.gl/compression@4.0.0-alpha.21(transitive)
- Removed@loaders.gl/loader-utils@4.0.0-alpha.21(transitive)
- Removed@loaders.gl/worker-utils@4.0.0-alpha.21(transitive)