@@ -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
@@ -352,7 +352,7 @@ module.exports = function (/*String*/input) {
352
352
*
353
353
* @return Boolean
354
354
*/
355
- extractEntryTo : function ( /*Object*/ entry , /*String*/ targetPath , /*Boolean*/ maintainEntryPath , /*Boolean*/ overwrite ) {
355
+ extractEntryTo : function ( /** Object*/ entry , /** String*/ targetPath , /** Boolean*/ maintainEntryPath , /* *Boolean*/ overwrite ) {
356
356
overwrite = overwrite || false ;
357
357
maintainEntryPath = typeof maintainEntryPath === "undefined" ? true : maintainEntryPath ;
358
358
@@ -424,7 +424,7 @@ module.exports = function (/*String*/input) {
424
424
* @param overwrite If the file already exists at the target path, the file will be overwriten if this is true.
425
425
* Default is FALSE
426
426
*/
427
- extractAllTo : function ( /*String*/ targetPath , /*Boolean*/ overwrite ) {
427
+ extractAllTo : function ( /** String*/ targetPath , /* *Boolean*/ overwrite ) {
428
428
overwrite = overwrite || false ;
429
429
if ( ! _zip ) {
430
430
throw Utils . Errors . NO_ZIP ;
@@ -456,7 +456,7 @@ module.exports = function (/*String*/input) {
456
456
* Default is FALSE
457
457
* @param callback
458
458
*/
459
- extractAllToAsync : function ( /*String*/ targetPath , /*Boolean*/ overwrite , /*Function*/ callback ) {
459
+ extractAllToAsync : function ( /** String*/ targetPath , /** Boolean*/ overwrite , /* *Function*/ callback ) {
460
460
if ( ! callback ) {
461
461
callback = function ( ) { }
462
462
}
@@ -516,7 +516,7 @@ module.exports = function (/*String*/input) {
516
516
* @param targetFileName
517
517
* @param callback
518
518
*/
519
- writeZip : function ( /*String*/ targetFileName , /*Function*/ callback ) {
519
+ writeZip : function ( /** String*/ targetFileName , /* *Function*/ callback ) {
520
520
if ( arguments . length === 1 ) {
521
521
if ( typeof targetFileName === "function" ) {
522
522
callback = targetFileName ;
@@ -541,7 +541,7 @@ module.exports = function (/*String*/input) {
541
541
*
542
542
* @return Buffer
543
543
*/
544
- toBuffer : function ( /*Function*/ onSuccess , /*Function*/ onFail , /*Function*/ onItemStart , /*Function*/ onItemEnd ) {
544
+ toBuffer : function ( /** Function= */ onSuccess , /** Function= */ onFail , /** Function= */ onItemStart , /** Function= */ onItemEnd ) {
545
545
this . valueOf = 2 ;
546
546
if ( typeof onSuccess === "function" ) {
547
547
_zip . toAsyncBuffer ( onSuccess , onFail , onItemStart , onItemEnd ) ;
0 commit comments