@@ -10,7 +10,7 @@ var ZipEntry = require("./zipEntry"),
10
10
var isWin = / ^ w i n / . test ( process . platform ) ;
11
11
12
12
13
- module . exports = function ( /*String*/ input ) {
13
+ module . exports = function ( /** String*/ input ) {
14
14
var _zip = undefined ,
15
15
_filename = "" ;
16
16
@@ -39,7 +39,7 @@ module.exports = function (/*String*/input) {
39
39
return pth . normalize ( pth . join ( prefix , pth . basename ( name ) ) ) ;
40
40
}
41
41
42
- function getEntry ( /*Object*/ entry ) {
42
+ function getEntry ( /** Object*/ entry ) {
43
43
if ( entry && _zip ) {
44
44
var item ;
45
45
// If entry was given as a file name
@@ -63,7 +63,7 @@ module.exports = function (/*String*/input) {
63
63
*
64
64
* @return Buffer or Null in case of error
65
65
*/
66
- readFile : function ( /*Object*/ entry ) {
66
+ readFile : function ( /** Object*/ entry ) {
67
67
var item = getEntry ( entry ) ;
68
68
return item && item . getData ( ) || null ;
69
69
} ,
@@ -75,7 +75,7 @@ module.exports = function (/*String*/input) {
75
75
*
76
76
* @return Buffer or Null in case of error
77
77
*/
78
- readFileAsync : function ( /*Object*/ entry , /*Function*/ callback ) {
78
+ readFileAsync : function ( /** Object*/ entry , /* *Function*/ callback ) {
79
79
var item = getEntry ( entry ) ;
80
80
if ( item ) {
81
81
item . getDataAsync ( callback ) ;
@@ -91,7 +91,7 @@ module.exports = function (/*String*/input) {
91
91
*
92
92
* @return String
93
93
*/
94
- readAsText : function ( /*Object*/ entry , /*String - Optional */ encoding ) {
94
+ readAsText : function ( /** Object*/ entry , /** String= */ encoding ) {
95
95
var item = getEntry ( entry ) ;
96
96
if ( item ) {
97
97
var data = item . getData ( ) ;
@@ -110,7 +110,7 @@ module.exports = function (/*String*/input) {
110
110
*
111
111
* @return String
112
112
*/
113
- readAsTextAsync : function ( /*Object*/ entry , /*Function*/ callback , /*String - Optional */ encoding ) {
113
+ readAsTextAsync : function ( /** Object*/ entry , /** Function*/ callback , /** String= */ encoding ) {
114
114
var item = getEntry ( entry ) ;
115
115
if ( item ) {
116
116
item . getDataAsync ( function ( data , err ) {
@@ -135,7 +135,7 @@ module.exports = function (/*String*/input) {
135
135
*
136
136
* @param entry
137
137
*/
138
- deleteFile : function ( /*Object*/ entry ) { // @TODO : test deleteFile
138
+ deleteFile : function ( /** Object*/ entry ) { // @TODO : test deleteFile
139
139
var item = getEntry ( entry ) ;
140
140
if ( item ) {
141
141
_zip . deleteEntry ( item . entryName ) ;
@@ -147,7 +147,7 @@ module.exports = function (/*String*/input) {
147
147
*
148
148
* @param comment
149
149
*/
150
- addZipComment : function ( /*String*/ comment ) { // @TODO : test addZipComment
150
+ addZipComment : function ( /** String*/ comment ) { // @TODO : test addZipComment
151
151
_zip . comment = comment ;
152
152
} ,
153
153
@@ -167,7 +167,7 @@ module.exports = function (/*String*/input) {
167
167
* @param entry
168
168
* @param comment
169
169
*/
170
- addZipEntryComment : function ( /*Object*/ entry , /*String*/ comment ) {
170
+ addZipEntryComment : function ( /** Object*/ entry , /* *String*/ comment ) {
171
171
var item = getEntry ( entry ) ;
172
172
if ( item ) {
173
173
item . comment = comment ;
@@ -180,7 +180,7 @@ module.exports = function (/*String*/input) {
180
180
* @param entry
181
181
* @return String
182
182
*/
183
- getZipEntryComment : function ( /*Object*/ entry ) {
183
+ getZipEntryComment : function ( /** Object*/ entry ) {
184
184
var item = getEntry ( entry ) ;
185
185
if ( item ) {
186
186
return item . comment || '' ;
@@ -194,7 +194,7 @@ module.exports = function (/*String*/input) {
194
194
* @param entry
195
195
* @param content
196
196
*/
197
- updateFile : function ( /*Object*/ entry , /*Buffer*/ content ) {
197
+ updateFile : function ( /** Object*/ entry , /* *Buffer*/ content ) {
198
198
var item = getEntry ( entry ) ;
199
199
if ( item ) {
200
200
item . setData ( content ) ;
@@ -208,7 +208,7 @@ module.exports = function (/*String*/input) {
208
208
* @param zipPath Optional path inside the zip
209
209
* @param zipName Optional name for the file
210
210
*/
211
- addLocalFile : function ( /*String*/ localPath , /*String*/ zipPath , /*String*/ zipName ) {
211
+ addLocalFile : function ( /** String*/ localPath , /** String= */ zipPath , /** String= */ zipName ) {
212
212
if ( fs . existsSync ( localPath ) ) {
213
213
if ( zipPath ) {
214
214
zipPath = zipPath . split ( "\\" ) . join ( "/" ) ;
@@ -238,7 +238,7 @@ module.exports = function (/*String*/input) {
238
238
* @param filter optional RegExp or Function if files match will
239
239
* be included.
240
240
*/
241
- addLocalFolder : function ( /*String*/ localPath , /*String*/ zipPath , /*RegExp|Function*/ filter ) {
241
+ addLocalFolder : function ( /** String*/ localPath , /** String= */ zipPath , /**= RegExp|Function*/ filter ) {
242
242
if ( filter === undefined ) {
243
243
filter = function ( ) {
244
244
return true ;
@@ -297,7 +297,7 @@ module.exports = function (/*String*/input) {
297
297
* @param comment
298
298
* @param attr
299
299
*/
300
- addFile : function ( /*String*/ entryName , /*Buffer*/ content , /*String*/ comment , /*Number*/ attr ) {
300
+ addFile : function ( /** String*/ entryName , /** Buffer*/ content , /** String*/ comment , /* *Number*/ attr ) {
301
301
var entry = new ZipEntry ( ) ;
302
302
entry . entryName = entryName ;
303
303
entry . comment = comment || "" ;
@@ -335,7 +335,7 @@ module.exports = function (/*String*/input) {
335
335
* @param name
336
336
* @return ZipEntry
337
337
*/
338
- getEntry : function ( /*String*/ name ) {
338
+ getEntry : function ( /** String*/ name ) {
339
339
return getEntry ( name ) ;
340
340
} ,
341
341
@@ -360,7 +360,7 @@ module.exports = function (/*String*/input) {
360
360
*
361
361
* @return Boolean
362
362
*/
363
- extractEntryTo : function ( /*Object*/ entry , /*String*/ targetPath , /*Boolean*/ maintainEntryPath , /*Boolean*/ overwrite ) {
363
+ extractEntryTo : function ( /** Object*/ entry , /** String*/ targetPath , /** Boolean*/ maintainEntryPath , /* *Boolean*/ overwrite ) {
364
364
overwrite = overwrite || false ;
365
365
maintainEntryPath = typeof maintainEntryPath === "undefined" ? true : maintainEntryPath ;
366
366
@@ -432,7 +432,7 @@ module.exports = function (/*String*/input) {
432
432
* @param overwrite If the file already exists at the target path, the file will be overwriten if this is true.
433
433
* Default is FALSE
434
434
*/
435
- extractAllTo : function ( /*String*/ targetPath , /*Boolean*/ overwrite ) {
435
+ extractAllTo : function ( /** String*/ targetPath , /* *Boolean*/ overwrite ) {
436
436
overwrite = overwrite || false ;
437
437
if ( ! _zip ) {
438
438
throw Utils . Errors . NO_ZIP ;
@@ -464,7 +464,7 @@ module.exports = function (/*String*/input) {
464
464
* Default is FALSE
465
465
* @param callback
466
466
*/
467
- extractAllToAsync : function ( /*String*/ targetPath , /*Boolean*/ overwrite , /*Function*/ callback ) {
467
+ extractAllToAsync : function ( /** String*/ targetPath , /** Boolean*/ overwrite , /* *Function*/ callback ) {
468
468
if ( ! callback ) {
469
469
callback = function ( ) { }
470
470
}
@@ -524,7 +524,7 @@ module.exports = function (/*String*/input) {
524
524
* @param targetFileName
525
525
* @param callback
526
526
*/
527
- writeZip : function ( /*String*/ targetFileName , /*Function*/ callback ) {
527
+ writeZip : function ( /** String*/ targetFileName , /* *Function*/ callback ) {
528
528
if ( arguments . length === 1 ) {
529
529
if ( typeof targetFileName === "function" ) {
530
530
callback = targetFileName ;
@@ -549,7 +549,7 @@ module.exports = function (/*String*/input) {
549
549
*
550
550
* @return Buffer
551
551
*/
552
- toBuffer : function ( /*Function*/ onSuccess , /*Function*/ onFail , /*Function*/ onItemStart , /*Function*/ onItemEnd ) {
552
+ toBuffer : function ( /** Function= */ onSuccess , /** Function= */ onFail , /** Function= */ onItemStart , /** Function= */ onItemEnd ) {
553
553
this . valueOf = 2 ;
554
554
if ( typeof onSuccess === "function" ) {
555
555
_zip . toAsyncBuffer ( onSuccess , onFail , onItemStart , onItemEnd ) ;
0 commit comments