2 title: "filter(predicate)"
7 __Description__ : Filter nested files/folders with the specified function.
11 name | type | description
12 ----------|----------|------------
13 predicate | function | the predicate to use.
15 The predicate has the following signature : `function (relativePath, file) {...}` :
17 name | type | description
18 -------------|-----------|------------
19 relativePath | string | the filename and its path, reliatively to the current folder.
20 file | ZipObject | the file being tested. See [ZipObject]({{site.baseurl}}/documentation/api_zipobject.html).
22 The predicate must return true if the file should be included, false otherwise.
25 __Returns__ : An array of matching ZipObject.
29 <!-- __Complexity__ : **O(k)** where k is the number of entries. -->
34 var zip = new JSZip().folder("dir");
35 zip.file("readme.txt", "content");
36 zip.filter(function (relativePath, file){
37 // relativePath == "readme.txt"
38 // file = {name:"dir/readme.txt",options:{...},asText:function}