Skip to content
Snippets Groups Projects
Commit dd60fe7b authored by Praveen Arimbrathodiyil's avatar Praveen Arimbrathodiyil
Browse files

New upstream version 3.2.2+dfsg

parent c71ff9b2
No related branches found
Tags upstream/3.2.2+dfsg
No related merge requests found
Showing
with 154 additions and 152 deletions
......@@ -13,7 +13,8 @@
"globals": {
"TextEncoder": false,
"TextDecoder": false
"TextDecoder": false,
"self": true
},
"browser": true,
"node": true
......
......@@ -4,11 +4,7 @@ matrix:
include:
- node_js: "stable"
env: COMMAND=lint
- node_js: "0.10"
env: COMMAND=test-node
- node_js: "0.12"
env: COMMAND=test-node
- node_js: "4.4"
- node_js: "lts/*"
env: COMMAND=test-node
- node_js: "stable"
env: COMMAND=test-node
......
......@@ -4,6 +4,25 @@ layout: default
section: main
---
### v3.2.2 2019-07-04
- No public changes, but a number of testing dependencies have been updated.
- Tested browsers are now: Internet Explorer 11, Chrome (most recent) and Firefox (most recent). Other browsers (specifically Safari) are still supported however testing them on Saucelabs is broken and so they were removed from the test matrix.
### v3.2.1 2019-03-22
- Corrected built dist files
### v3.2.0 2019-02-21
- Update dependencies to reduce bundle size (see [#532](https://github.com/Stuk/jszip/pull/532)).
- Fix deprecated Buffer constructor usage and add safeguards (see [#506](https://github.com/Stuk/jszip/pull/506)).
### v3.1.5 2017-11-09
- Fix IE11 memory leak (see [#429](https://github.com/Stuk/jszip/pull/429)).
- Handle 2 nodejs deprecations (see [#459](https://github.com/Stuk/jszip/pull/459)).
- Improve the "unsupported format" error message (see [#461](https://github.com/Stuk/jszip/pull/461)).
- Improve webworker compatibility (see [#468](https://github.com/Stuk/jszip/pull/468)).
- Fix nodejs 0.10 compatibility (see [#480](https://github.com/Stuk/jszip/pull/480)).
- Improve the error without type in async() (see [#481](https://github.com/Stuk/jszip/pull/481)).
### v3.1.4 2017-08-24
- consistently use our own utils object for inheritance (see [#395](https://github.com/Stuk/jszip/pull/395)).
- lower the memory consumption in `generate*` with a lot of files (see [#449](https://github.com/Stuk/jszip/pull/449)).
......
/*jshint node: true */
'use strict';
"use strict";
module.exports = function(grunt) {
// see https://saucelabs.com/rest/v1/info/browsers/webdriver
var browsers = [{
browserName: "iphone",
version: "7.0"
}, {
browserName: "iphone",
version: "9.2"
}, {
browserName: "android",
platform: "Linux",
version: "4.0"
}, {
browserName: "android",
platform: "Linux",
version: "4.4"
}, {
browserName: "android",
platform: "Linux",
version: "5.1"
}, {
browserName: "firefox",
platform: "Windows 10"
}, {
browserName: "chrome",
platform: "Windows 10"
}, {
browserName: "internet explorer",
platform: "XP",
version: "6"
}, {
browserName: "internet explorer",
platform: "XP",
version: "7"
}, {
browserName: "internet explorer",
platform: "Windows 7",
version: "8"
}, {
browserName: "internet explorer",
platform: "Windows 7",
version: "9"
}, {
browserName: "internet explorer",
platform: "Windows 8",
version: "10"
}, {
browserName: "internet explorer",
platform: "Windows 10",
version: "11"
}, {
browserName: "MicrosoftEdge",
platform: "Windows 10",
version: "13"
}, {
browserName: "opera",
platform: "Windows 2008",
version: "12"
}, {
browserName: "safari",
platform: "OS X 10.8",
version: "6"
}, {
browserName: "safari",
platform: "OS X 10.9",
version: "7"
}, {
browserName: "safari",
platform: "OS X 10.10",
version: "8"
}, {
browserName: "safari",
platform: "OS X 10.11",
version: "9"
}];
// https://wiki.saucelabs.com/display/DOCS/Platform+Configurator
// A lot of the browsers seem to time out with Saucelab's unit testing
// framework. Here are the browsers that work and get enough coverage for our
// needs.
var browsers = [
{browserName: "chrome"},
{browserName: "firefox", platform: "Linux"},
{browserName: "internet explorer"}
];
var tags = [];
if (process.env.TRAVIS_PULL_REQUEST && process.env.TRAVIS_PULL_REQUEST != "false") {
......@@ -86,46 +22,52 @@ module.exports = function(grunt) {
var version = require("./package.json").version;
grunt.initConfig({
connect: {
server: {
options: {
base: "",
port: 9999
}
}
},
'saucelabs-qunit': {
all: {
options: {
urls: ["http://127.0.0.1:9999/test/index.html?hidepassed"],
build: process.env.TRAVIS_JOB_ID,
throttled: 3,
"max-duration" : 600, // seconds, IE6 is slow
browsers: browsers,
testname: "qunit tests",
tags: tags
}
}
},
jshint: {
// see https://github.com/gruntjs/grunt-contrib-jshint/issues/198
// we can't override the options using the jshintrc path
options: grunt.file.readJSON('.jshintrc'),
production: ['./lib/**/*.js'],
test: ['./test/helpers/**/*.js', './test/asserts/**/*.js'],
documentation: {
options: {
// we include js files with jekyll, jshint can't see all
// variables and we can't declare all of them
undef: false,
// 'implied' still give false positives in our case
strict: false
},
files: {
src: ['./documentation/**/*.js']
}
}
},
connect: {
server: {
options: {
base: "",
port: 8080
}
}
},
'saucelabs-qunit': {
all: {
options: {
urls: ["http://127.0.0.1:8080/test/index.html?hidepassed"],
build: process.env.TRAVIS_JOB_ID,
throttled: 4,
"max-duration": 1200, // seconds, IE6 is slow
browsers: browsers,
testname: "qunit tests",
tags: tags,
// Tests have statusCheckAttempts * pollInterval seconds to complete
pollInterval: 2000,
statusCheckAttempts: 240,
"max-duration": 1200,
browsers: browsers,
maxRetries: 2
}
}
},
jshint: {
// see https://github.com/gruntjs/grunt-contrib-jshint/issues/198
// we can't override the options using the jshintrc path
options: grunt.file.readJSON('.jshintrc'),
production: ['./lib/**/*.js'],
test: ['./test/helpers/**/*.js', './test/asserts/**/*.js'],
documentation: {
options: {
// we include js files with jekyll, jshint can't see all
// variables and we can't declare all of them
undef: false,
// 'implied' still give false positives in our case
strict: false
},
files: {
src: ['./documentation/**/*.js']
}
}
},
browserify: {
all: {
files: {
......@@ -136,14 +78,14 @@ module.exports = function(grunt) {
standalone: 'JSZip',
transform: ['package-json-versionify'],
insertGlobalVars: {
process: undefined,
Buffer: undefined,
__filename: undefined,
__dirname: undefined
process: undefined,
Buffer: undefined,
__filename: undefined,
__dirname: undefined
},
builtins: false
},
banner : grunt.file.read('lib/license_header.js').replace(/__VERSION__/, version)
banner: grunt.file.read('lib/license_header.js').replace(/__VERSION__/, version)
}
}
},
......@@ -151,29 +93,33 @@ module.exports = function(grunt) {
options: {
mangle: true,
preserveComments: false,
banner : grunt.file.read('lib/license_header.js').replace(/__VERSION__/, version)
banner: grunt.file.read('lib/license_header.js').replace(/__VERSION__/, version)
},
all: {
src: 'dist/jszip.js',
dest: 'dist/jszip.min.js'
}
},
qunit: {
all: ['test/**/*.html']
}
});
grunt.loadNpmTasks("grunt-saucelabs");
grunt.loadNpmTasks("grunt-contrib-connect");
grunt.loadNpmTasks("grunt-saucelabs");
grunt.loadNpmTasks('grunt-browserify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-qunit');
// A task to cause Grunt to sit and wait, keeping the test server running
grunt.registerTask("wait", function() {
this.async();
});
grunt.registerTask("test-local", ["build", "connect", "wait"]);
grunt.registerTask("test-remote", ["build", "connect", "saucelabs-qunit"]);
if (process.env.SAUCE_USERNAME && process.env.SAUCE_ACCESS_KEY) {
grunt.registerTask("test", ["qunit", "connect", "saucelabs-qunit"]);
grunt.registerTask("test", ["jshint", "test-remote"]);
} else {
grunt.registerTask("test", ["qunit"]);
grunt.registerTask("test", ["jshint", "test-local"]);
}
grunt.registerTask("build", ["browserify", "uglify"]);
grunt.registerTask("default", ["jshint", "build"]);
......
......@@ -3,7 +3,7 @@ JSZip [![Build Status](https://api.travis-ci.org/Stuk/jszip.svg?branch=master)](
[![Selenium Test Status](https://saucelabs.com/browser-matrix/jszip.svg)](https://saucelabs.com/u/jszip)
A library for creating, reading and editing .zip files with Javascript, with a
A library for creating, reading and editing .zip files with JavaScript, with a
lovely and simple API.
See https://stuk.github.io/jszip for all the documentation.
......
......@@ -4,7 +4,7 @@
"authors": [
"Stuart Knightley <stuart@stuartk.com>"
],
"description": "Create, read and edit .zip files with Javascript http://stuartk.com/jszip",
"description": "Create, read and edit .zip files with JavaScript http://stuartk.com/jszip",
"main": "dist/jszip.js",
"keywords": [
"zip",
......
{
"name": "jszip",
"repo": "Stuk/jszip",
"description": "Create, read and edit .zip files with Javascript http://stuartk.com/jszip",
"version": "3.1.4",
"description": "Create, read and edit .zip files with JavaScript http://stuartk.com/jszip",
"version": "3.2.0",
"keywords": [
"zip",
"deflate",
......
......@@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Create .zip files using Javascript. Provides a simple API to place any content generated by Javascript into a .zip file for your users." />
<meta name="description" content="Create .zip files using JavaScript. Provides a simple API to place any content generated by JavaScript into a .zip file for your users." />
<title>{{page.title}}</title>
<!--
......
......@@ -9,7 +9,7 @@ Search a file in the current folder and subfolders with a
The regex is tested against the relative filename.
__Returns__ : An array of matching files (an empty array if none matched). Each
maching file is an instance of [ZipObject]({{site.baseurl}}/documentation/api_zipobject.html).
matching file is an instance of [ZipObject]({{site.baseurl}}/documentation/api_zipobject.html).
__Since__: v1.0.0
......
......@@ -20,7 +20,7 @@ The predicate has the following signature : `function (relativePath, file) {...}
name | type | description
-------------|-----------|------------
relativePath | string | the filename and its path, reliatively to the current folder.
relativePath | string | the filename and its path, relative to the current folder.
file | ZipObject | the file being tested. See [ZipObject]({{site.baseurl}}/documentation/api_zipobject.html).
The predicate must return true if the file should be included, false otherwise.
......
......@@ -9,7 +9,7 @@ Search a subdirectory in the current directory with a
The regex is tested against the relative path.
__Returns__ : An array of matching folders (an empty array if none matched).
Each maching folder is an instance of [ZipObject]({{site.baseurl}}/documentation/api_zipobject.html).
Each matching folder is an instance of [ZipObject]({{site.baseurl}}/documentation/api_zipobject.html).
__Since__: v1.0.0
......
......@@ -20,7 +20,7 @@ The callback has the following signature : `function (relativePath, file) {...}`
name | type | description
-------------|-----------|------------
relativePath | string | the filename and its path, reliatively to the current folder.
relativePath | string | the filename and its path, relative to the current folder.
file | ZipObject | the current file. See [ZipObject]({{site.baseurl}}/documentation/api_zipobject.html).
......
......@@ -98,7 +98,7 @@ Note, this won't change the content of the file, only the other programs *may*
see it.
```js
//This example will Generate a Open Document Spreasheet, with the correct mime type
//This example will Generate a Open Document Spreadsheet, with the correct mime type
var zip = new JSZip();
zip.file("mimetype", "application/vnd.oasis.opendocument.spreadsheet");
var metaInf = zip.folder("META-INF");
......
......@@ -8,7 +8,7 @@ Register a listener on an event.
__Returns__ : The current StreamHelper object, for chaining.
__Throws__ : An exception if the event is unkown.
__Throws__ : An exception if the event is unknown.
## Arguments
......
......@@ -34,7 +34,7 @@ Note : when using type = "uint8array", "arraybuffer" or "blob", be sure to
check if the browser supports it (you can use [`JSZip.support`]({{site.baseurl}}/documentation/api_jszip/support.html)).
```js
zip.file("image.png").async({type: "uint8array"}).then(function (u8) {
zip.file("image.png").async("uint8array").then(function (u8) {
// ...
});
```
......@@ -54,7 +54,7 @@ name | type | description
percent | number | the percent of completion (a double between 0 and 100)
```js
zip.file("image.png").async({type: "uint8array"}, function updateCallback(metadata) {
zip.file("image.png").async("uint8array", function updateCallback(metadata) {
console.log("progression: " + metadata.percent.toFixed(2) + " %");
}).then(function (u8) {
// ...
......
......@@ -114,7 +114,7 @@ var new_zip = new JSZip();
new_zip.loadAsync(content)
.then(function(zip) {
// you now have every files contained in the loaded zip
new_zip.file("hello.txt").async("string"); // a promise of "Hello World\n"
zip.file("hello.txt").async("string"); // a promise of "Hello World\n"
});
```
......@@ -16,3 +16,43 @@ decode the binary content as a text and corrupt it. See
That happens if you try to handle to much data with the synchronous API. If
possible, try the asynchronous API, see
[this page]({{site.baseurl}}/documentation/limitations.html) for more informations.
### Can't read the data of [...]. Is it in a supported JavaScript type ?
Or the old message:
> The data of [...] is in an unsupported format
The method [`file(name, data [,options])`]({{site.baseurl}}/documentation/api_jszip/file_data.html)
accepts string and binary inputs for `data`.
If you use an unsupported type, an object for example, you will get this error:
```js
// WRONG
var data = {
content: new ArrayBuffer(...)
};
zip.file("my.data", data); // won't work, data is an object
// CORRECT
var data = new ArrayBuffer(...);
zip.file("my.data", data); // will work, JSZip accepts ArrayBuffer
```
### My mac generates a `.cpgz` file when I try to extract the zip file
MacOS Finder has a lot of bug related to zip files (the `unzip` command line
tool is fine). When something goes wrong, Finder will generate this cpgz file
instead of showing an error.
To get a correct result, try to enable compression in `generateAsync`:
```js
zip.generateAsync({
type:"...",
compression: "DEFLATE" // <-- here
});
```
Using `platform: "UNIX"` may help too.
......@@ -7,7 +7,7 @@ fullpage: true
### Not supported features
All the features of zip files are not supported. Classic zip files will work
Not all features of zip files are supported. Classic zip files will work
but encrypted zip, multi-volume, etc are not supported and the loadAsync()
method will return a failed promise.
......@@ -15,7 +15,7 @@ method will return a failed promise.
### ZIP64 and 32bit integers
ZIP64 files can be loaded, but only if the zip file is not "too big". ZIP64 uses 64bits integers
but Javascript represents all numbers as
but JavaScript represents all numbers as
[64-bit double precision IEEE 754 floating point numbers](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf)
(see section 8.5). So, we have 53bits for integers and
[bitwise operations treat everything as 32bits](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_Operators).
......
......@@ -13,7 +13,7 @@ lovely and simple API.
</div>
<div class="col-md-7">
<p>
<strong>Current version</strong> : v3.1.4
<strong>Current version</strong> : v3.2.0
</p>
<p>
<strong>License</strong> : JSZip is dual-licensed. You may use it under the
......
......@@ -42,7 +42,7 @@ JSZip.defaults = require('./defaults');
// TODO find a better way to handle this version,
// a require('package.json').version doesn't work with webpack, see #327
JSZip.version = "3.1.4";
JSZip.version = "3.2.0";
JSZip.loadAsync = function (content, options) {
return new JSZip().loadAsync(content, options);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment