@loaders.gl/zip
Advanced tools
Comparing version 1.3.0-beta.1 to 1.3.0-beta.2
@@ -1,4 +0,4 @@ | ||
var moduleExports = require('./index'); | ||
const moduleExports = require('./index'); | ||
var _global = typeof window === 'undefined' ? global : window; | ||
const _global = typeof window === 'undefined' ? global : window; | ||
@@ -5,0 +5,0 @@ _global.loaders = _global.loaders || {}; |
import JSZip from 'jszip'; | ||
export var ZipLoader = { | ||
export const ZipLoader = { | ||
name: 'Zip Archive', | ||
@@ -10,9 +10,9 @@ extensions: ['zip'], | ||
function parseZipAsync(data, options) { | ||
var promises = []; | ||
var fileMap = {}; | ||
var jsZip = new JSZip(); | ||
const promises = []; | ||
const fileMap = {}; | ||
const jsZip = new JSZip(); | ||
return jsZip.loadAsync(data, options).then(zip => { | ||
zip.forEach((relativePath, zipEntry) => { | ||
var subFilename = zipEntry.name; | ||
var promise = jsZip.file(subFilename).async(options.dataType || 'arraybuffer').then(arrayBuffer => { | ||
const subFilename = zipEntry.name; | ||
const promise = jsZip.file(subFilename).async(options.dataType || 'arraybuffer').then(arrayBuffer => { | ||
fileMap[relativePath] = arrayBuffer; | ||
@@ -19,0 +19,0 @@ }).catch(error => { |
import JSZip from 'jszip'; | ||
export var ZipWriter = { | ||
export const ZipWriter = { | ||
name: 'Zip Archive', | ||
@@ -11,6 +11,6 @@ extensions: ['zip'], | ||
function encodeZipAsync(fileMap, options) { | ||
var jsZip = new JSZip(); | ||
const jsZip = new JSZip(); | ||
for (var subFileName in fileMap) { | ||
var subFileData = fileMap[subFileName]; | ||
for (const subFileName in fileMap) { | ||
const subFileData = fileMap[subFileName]; | ||
jsZip.file(subFileName, subFileData, options); | ||
@@ -22,3 +22,3 @@ } | ||
}); | ||
var { | ||
const { | ||
onUpdate = () => {} | ||
@@ -25,0 +25,0 @@ } = options; |
{ | ||
"name": "@loaders.gl/zip", | ||
"version": "1.3.0-beta.1", | ||
"version": "1.3.0-beta.2", | ||
"description": "Zip Archive Loader", | ||
@@ -33,6 +33,6 @@ "license": "MIT", | ||
"dependencies": { | ||
"@loaders.gl/core": "1.3.0-beta.1", | ||
"@loaders.gl/core": "1.3.0-beta.2", | ||
"jszip": "^3.1.5" | ||
}, | ||
"gitHead": "deabcc69303bc19eeadb1bb6cf9082ee94e74f3e" | ||
"gitHead": "ea8078ed5fda7d06dfaae4aed02a46ca1c181bd3" | ||
} |
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
787416
+ Added@loaders.gl/core@1.3.0-beta.2(transitive)
- Removed@loaders.gl/core@1.3.0-beta.1(transitive)