@@ -27,11 +27,12 @@ var ZipArchiveEntry = module.exports = function(name) {
2727 this . size = - 1 ;
2828 this . csize = - 1 ;
2929 this . gpb = new GeneralPurposeBit ( ) ;
30- this . crc = - 1 ;
30+ this . crc = 0 ;
3131 this . time = - 1 ;
3232
33+ this . minver = constants . INITIAL_VERSION ;
3334 this . mode = - 1 ;
34- this . extra = 0 ;
35+ this . extra = null ;
3536 this . exattr = 0 ;
3637 this . inattr = 0 ;
3738 this . comment = null ;
@@ -43,8 +44,13 @@ var ZipArchiveEntry = module.exports = function(name) {
4344
4445inherits ( ZipArchiveEntry , ArchiveEntry ) ;
4546
47+ ZipArchiveEntry . prototype . getCentralDirectoryExtra = function ( ) {
48+ var extra = this . getExtra ( ) ;
49+ return extra !== null ? extra : constants . EMPTY ;
50+ } ;
51+
4652ZipArchiveEntry . prototype . getComment = function ( ) {
47- return this . comment ;
53+ return this . comment !== null ? this . comment : constants . EMPTY ;
4854} ;
4955
5056ZipArchiveEntry . prototype . getCompressedSize = function ( ) {
@@ -59,6 +65,10 @@ ZipArchiveEntry.prototype.getExternalAttributes = function() {
5965 return this . exattr ;
6066} ;
6167
68+ ZipArchiveEntry . prototype . getExtra = function ( ) {
69+ return this . extra ;
70+ } ;
71+
6272ZipArchiveEntry . prototype . getGeneralPurposeBit = function ( ) {
6373 return this . gpb ;
6474} ;
@@ -71,6 +81,11 @@ ZipArchiveEntry.prototype.getLastModifiedDate = function() {
7181 return this . getTime ( ) ;
7282} ;
7383
84+ ZipArchiveEntry . prototype . getLocalFileDataExtra = function ( ) {
85+ var extra = this . getExtra ( ) ;
86+ return extra !== null ? extra : constants . EMPTY ;
87+ } ;
88+
7489ZipArchiveEntry . prototype . getMethod = function ( ) {
7590 return this . method ;
7691} ;
@@ -101,6 +116,10 @@ ZipArchiveEntry.prototype.getUnixMode = function() {
101116 return this . platform !== constants . PLATFORM_UNIX ? 0 : ( ( this . getExternalAttributes ( ) >> constants . SHORT_SHIFT ) & constants . SHORT_MASK ) ;
102117} ;
103118
119+ ZipArchiveEntry . prototype . getVersionNeededToExtract = function ( ) {
120+ return this . minver ;
121+ } ;
122+
104123ZipArchiveEntry . prototype . setComment = function ( comment ) {
105124 this . comment = comment ;
106125} ;
@@ -125,6 +144,10 @@ ZipArchiveEntry.prototype.setExternalAttributes = function(attr) {
125144 this . exattr = attr ;
126145} ;
127146
147+ ZipArchiveEntry . prototype . setExtra = function ( extra ) {
148+ this . extra = extra ;
149+ } ;
150+
128151ZipArchiveEntry . prototype . setGeneralPurposeBit = function ( gpb ) {
129152 if ( ! ( gpb instanceof GeneralPurposeBit ) ) {
130153 throw new Error ( 'invalid entry GeneralPurposeBit' ) ;
@@ -179,6 +202,10 @@ ZipArchiveEntry.prototype.setUnixMode = function(mode) {
179202 this . platform = constants . PLATFORM_UNIX ;
180203} ;
181204
205+ ZipArchiveEntry . prototype . setVersionNeededToExtract = function ( minver ) {
206+ this . minver = minver ;
207+ } ;
208+
182209ZipArchiveEntry . prototype . isDirectory = function ( ) {
183210 return this . getName ( ) . slice ( - 1 ) === '/' ;
184211} ;
0 commit comments