@loaders.gl/zip
Advanced tools
Comparing version 1.2.0-beta.2 to 1.2.0-beta.3
@@ -1,4 +0,4 @@ | ||
const moduleExports = require('./index'); | ||
var moduleExports = require('./index'); | ||
const _global = typeof window === 'undefined' ? global : window; | ||
var _global = typeof window === 'undefined' ? global : window; | ||
@@ -5,0 +5,0 @@ _global.loaders = _global.loaders || {}; |
import JSZip from 'jszip'; | ||
export const ZipLoader = { | ||
export var ZipLoader = { | ||
name: 'Zip Archive', | ||
@@ -10,9 +10,9 @@ extensions: ['zip'], | ||
function parseZipAsync(data, options) { | ||
const promises = []; | ||
const fileMap = {}; | ||
const jsZip = new JSZip(); | ||
var promises = []; | ||
var fileMap = {}; | ||
var jsZip = new JSZip(); | ||
return jsZip.loadAsync(data, options).then(zip => { | ||
zip.forEach((relativePath, zipEntry) => { | ||
const subFilename = zipEntry.name; | ||
const promise = jsZip.file(subFilename).async(options.dataType || 'arraybuffer').then(arrayBuffer => { | ||
var subFilename = zipEntry.name; | ||
var promise = jsZip.file(subFilename).async(options.dataType || 'arraybuffer').then(arrayBuffer => { | ||
fileMap[relativePath] = arrayBuffer; | ||
@@ -19,0 +19,0 @@ }).catch(error => { |
import JSZip from 'jszip'; | ||
export const ZipWriter = { | ||
export var ZipWriter = { | ||
name: 'Zip Archive', | ||
@@ -11,6 +11,6 @@ extensions: ['zip'], | ||
function encodeZipAsync(fileMap, options) { | ||
const jsZip = new JSZip(); | ||
var jsZip = new JSZip(); | ||
for (const subFileName in fileMap) { | ||
const subFileData = fileMap[subFileName]; | ||
for (var subFileName in fileMap) { | ||
var subFileData = fileMap[subFileName]; | ||
jsZip.file(subFileName, subFileData, options); | ||
@@ -22,3 +22,3 @@ } | ||
}); | ||
const { | ||
var { | ||
onUpdate = () => {} | ||
@@ -25,0 +25,0 @@ } = options; |
{ | ||
"name": "@loaders.gl/zip", | ||
"version": "1.2.0-beta.2", | ||
"version": "1.2.0-beta.3", | ||
"description": "Zip Archive Loader", | ||
@@ -33,6 +33,6 @@ "license": "MIT", | ||
"dependencies": { | ||
"@loaders.gl/core": "1.2.0-beta.2", | ||
"@loaders.gl/core": "1.2.0-beta.3", | ||
"jszip": "^3.1.5" | ||
}, | ||
"gitHead": "82626f4ecad7c816c70780376d661f267b6c523e" | ||
"gitHead": "39442622efe0e06323db958c53c9805fc9b7699d" | ||
} |
Sorry, the diff of this file is too big to display
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
788187
16389
+ Added@loaders.gl/core@1.2.0-beta.3(transitive)
- Removed@loaders.gl/core@1.2.0-beta.2(transitive)