compress-commons
Advanced tools
Comparing version 0.1.5 to 0.1.6
@@ -42,3 +42,27 @@ /** | ||
ZLIB_BEST_COMPRESSION: 9, | ||
ZLIB_DEFAULT_COMPRESSION: -1 | ||
ZLIB_DEFAULT_COMPRESSION: -1, | ||
MODE_MASK: 0xFFF, | ||
DEFAULT_FILE_MODE: 0100644, // 644 -rw-r--r-- = S_IFREG | S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH | ||
DEFAULT_DIR_MODE: 040755, // 755 drwxr-xr-x = S_IFDIR | S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH | ||
EXT_FILE_ATTR_DIR: 010173200020, // 755 drwxr-xr-x = (((S_IFDIR | 0755) << 16) | S_DOS_D) | ||
EXT_FILE_ATTR_FILE: 020151000040, // 644 -rw-r--r-- = (((S_IFREG | 0644) << 16) | S_DOS_A) >>> 0 | ||
// Unix file types | ||
S_IFIFO: 010000, // named pipe (fifo) | ||
S_IFCHR: 020000, // character special | ||
S_IFDIR: 040000, // directory | ||
S_IFBLK: 060000, // block special | ||
S_IFREG: 0100000, // regular | ||
S_IFLNK: 0120000, // symbolic link | ||
S_IFSOCK: 0140000, // socket | ||
// DOS file type flags | ||
S_DOS_A: 040, // Archive | ||
S_DOS_D: 020, // Directory | ||
S_DOS_V: 010, // Volume | ||
S_DOS_S: 04, // System | ||
S_DOS_H: 02, // Hidden | ||
S_DOS_R: 01 // Read Only | ||
}; |
@@ -112,3 +112,3 @@ /** | ||
ZipArchiveEntry.prototype.getUnixMode = function() { | ||
return this.platform !== constants.PLATFORM_UNIX ? 0 : ((this.getExternalAttributes() >> constants.SHORT_SHIFT) & constants.SHORT_MASK); | ||
return this.platform !== constants.PLATFORM_UNIX ? 0 : ((this.getExternalAttributes() >> constants.SHORT_SHIFT) & constants.SHORT_MASK) & constants.MODE_MASK; | ||
}; | ||
@@ -145,3 +145,3 @@ | ||
ZipArchiveEntry.prototype.setExternalAttributes = function(attr) { | ||
this.exattr = attr; | ||
this.exattr = attr >>> 0; | ||
}; | ||
@@ -204,4 +204,14 @@ | ||
ZipArchiveEntry.prototype.setUnixMode = function(mode) { | ||
this.setExternalAttributes((mode << constants.SHORT_SHIFT) | ((mode & 0200) === 0 ? 1 : 0) | (this.isDirectory() ? 0x10 : 0)); | ||
this.mode = mode; | ||
mode &= ~constants.S_IFDIR; | ||
var extattr = 0; | ||
if (!this.isDirectory()) { | ||
mode |= constants.S_IFREG; | ||
} | ||
extattr &= ~this.getExternalAttributes(); | ||
extattr |= (mode << constants.SHORT_SHIFT) | (this.isDirectory() ? constants.S_DOS_D : constants.S_DOS_A); | ||
this.setExternalAttributes(extattr); | ||
this.mode = mode & constants.MODE_MASK; | ||
this.platform = constants.PLATFORM_UNIX; | ||
@@ -208,0 +218,0 @@ }; |
{ | ||
"name": "compress-commons", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"description": "a library that defines a common interface for working with archives within node", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/ctalkington/node-compress-commons", |
@@ -1,2 +0,2 @@ | ||
# Compress Commons v0.1.5 [![Build Status](https://travis-ci.org/ctalkington/node-compress-commons.svg?branch=master)](https://travis-ci.org/ctalkington/node-compress-commons) | ||
# Compress Commons v0.1.6 [![Build Status](https://travis-ci.org/ctalkington/node-compress-commons.svg?branch=master)](https://travis-ci.org/ctalkington/node-compress-commons) | ||
@@ -3,0 +3,0 @@ Compress Commons is a library that defines a common interface for working with archives within node. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
28916
749