Socket
Socket
Sign inDemoInstall

archiver

Package Overview
Dependencies
Maintainers
1
Versions
83
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

archiver - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

tests/archiver-tar.js

3

lib/archiver/zip.js

@@ -14,2 +14,3 @@ var inherits = require('util').inherits;

comment: '',
forceUTC: false,
zlib: {

@@ -307,3 +308,3 @@ level: 6

if (utils.lo.isNumber(file.lastModifiedDate) === false) {
file.lastModifiedDate = utils.convertDateOctal(file.date);
file.lastModifiedDate = utils.dosDateTime(file.date, self.options.forceUTC);
}

@@ -310,0 +311,0 @@

@@ -43,16 +43,13 @@ var fs = require('fs');

utils.convertDateTimeDos = function(input) {
var d = {};
d.year = (input >> 25) + 1980;
d.month = ((input >> 21) & 0xF) - 1;
d.day = (input >> 16) & 0xF;
d.hour = (input >> 11) & 0xF;
d.minutes = (input >> 5) & 0xF;
d.seconds = (input & 0xF) * 2;
return new Date(d.year, d.month, d.day, d.hour, d.minutes, d.seconds);
return new Date(
((input >> 25) & 0x7f) + 1980,
((input >> 21) & 0x0f) - 1,
(input >> 16) & 0x1f,
(input >> 11) & 0x1f,
(input >> 5) & 0x3f,
(input & 0x1f) << 1);
};
utils.convertDateTimeOctal = function(input) {
input = parseInt(input, 10) * 1000;
input = parseInt(input, 8) * 1000;

@@ -62,6 +59,7 @@ return new Date(input);

utils.dosDateTime = function(d) {
utils.dosDateTime = function(d, utc) {
d = (d instanceof Date) ? d : new Date();
utc = utc || false;
var year = d.getFullYear();
var year = (utc === true) ? d.getUTCFullYear() : d.getFullYear();

@@ -72,4 +70,13 @@ if (year < 1980) {

return ((year-1980) << 25) | ((d.getMonth()+1) << 21) | (d.getDate() << 16) |
(d.getHours() << 11) | (d.getMinutes() << 5) | (d.getSeconds() >> 1);
var val = {
year: year,
month: (utc === true) ? d.getUTCMonth() : d.getMonth(),
date: (utc === true) ? d.getUTCDate() : d.getDate(),
hours: (utc === true) ? d.getUTCHours() : d.getHours(),
minutes: (utc === true) ? d.getUTCMinutes() : d.getMinutes(),
seconds: (utc === true) ? d.getUTCSeconds() : d.getSeconds()
};
return ((val.year-1980) << 25) | ((val.month+1) << 21) | (val.date << 16) |
(val.hours << 11) | (val.minutes << 5) | (val.seconds / 2);
};

@@ -76,0 +83,0 @@

{
"name": "archiver",
"version": "0.2.0",
"version": "0.2.1",
"description": "Creates Archives (ZIP) via Node Streams.",

@@ -28,3 +28,3 @@ "homepage": "https://github.com/ctalkington/node-archiver",

"scripts": {
"test": "nodeunit --reporter=minimal test/tests.js"
"test": "nodeunit tests"
},

@@ -31,0 +31,0 @@ "dependencies": {

@@ -37,2 +37,6 @@ # Archiver [![Build Status](https://secure.travis-ci.org/ctalkington/node-archiver.png?branch=master)](http://travis-ci.org/ctalkington/node-archiver)

#### forceUTC `boolean`
If true, forces file date and time to UTC. Helps with testing across timezones.
#### zlib `object`

@@ -39,0 +43,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc