Skip to content

Commit

Permalink
Small fixes (#339)
Browse files Browse the repository at this point in the history
* follow node LTS, node 4 has reached it’s end of life in April

* Removed lodash completely

* Removed deprecated constructor
  • Loading branch information
jimmywarting authored and ctalkington committed Aug 22, 2018
1 parent f7889bf commit dd7f10d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion benchmark/common.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function binaryBuffer(n) {
var buffer = new Buffer(n);
var buffer = Buffer.alloc(n);

for (var i = 0; i < n; i++) {
buffer.writeUInt8(i&255, i);
Expand Down
5 changes: 2 additions & 3 deletions lib/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
var fs = require('fs');
var glob = require('glob');
var async = require('async');
var _ = { extend: require('lodash.assign') };
var path = require('path');
var util = require('archiver-utils');

Expand Down Expand Up @@ -639,7 +638,7 @@ Archiver.prototype.directory = function(dirpath, destpath, data) {

function onGlobMatch(match){
var ignoreMatch = false;
var entryData = _.extend({}, data);
var entryData = Object.assign({}, data);
entryData.name = match;
entryData.prefix = destpath;
match = globber._makeAbs(match);
Expand Down Expand Up @@ -729,7 +728,7 @@ Archiver.prototype.glob = function(pattern, options, data) {
}

function onGlobMatch(match){
var entryData = _.extend({}, data);
var entryData = Object.assign({}, data);

if (options.cwd) {
entryData.name = match;
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"lib"
],
"engines": {
"node": ">= 4"
"node": ">= 6"
},
"scripts": {
"test": "mocha --reporter dot",
Expand All @@ -33,7 +33,6 @@
"async": "^2.0.0",
"buffer-crc32": "^0.2.1",
"glob": "^7.0.0",
"lodash.assign": "^4.2.0",
"readable-stream": "^2.0.0",
"tar-stream": "^1.5.0",
"zip-stream": "^1.2.0"
Expand Down
4 changes: 2 additions & 2 deletions test/helpers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function adjustDateByOffset(d, offset) {
module.exports.adjustDateByOffset = adjustDateByOffset;

function binaryBuffer(n) {
var buffer = new Buffer(n);
var buffer = Buffer.alloc(n);

for (var i = 0; i < n; i++) {
buffer.writeUInt8(i&255, i);
Expand All @@ -35,7 +35,7 @@ module.exports.binaryBuffer = binaryBuffer;
function BinaryStream(size, options) {
Readable.call(this, options);

var buf = new Buffer(size);
var buf = Buffer.alloc(size);

for (var i = 0; i < size; i++) {
buf.writeUInt8(i&255, i);
Expand Down

0 comments on commit dd7f10d

Please sign in to comment.