Skip to content

Commit dd7f10d

Browse files
jimmywartingctalkington
authored andcommitted
Small fixes (#339)
* follow node LTS, node 4 has reached it’s end of life in April * Removed lodash completely * Removed deprecated constructor
1 parent f7889bf commit dd7f10d

File tree

4 files changed

+6
-8
lines changed

4 files changed

+6
-8
lines changed

benchmark/common.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
function binaryBuffer(n) {
2-
var buffer = new Buffer(n);
2+
var buffer = Buffer.alloc(n);
33

44
for (var i = 0; i < n; i++) {
55
buffer.writeUInt8(i&255, i);

lib/core.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
var fs = require('fs');
99
var glob = require('glob');
1010
var async = require('async');
11-
var _ = { extend: require('lodash.assign') };
1211
var path = require('path');
1312
var util = require('archiver-utils');
1413

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

640639
function onGlobMatch(match){
641640
var ignoreMatch = false;
642-
var entryData = _.extend({}, data);
641+
var entryData = Object.assign({}, data);
643642
entryData.name = match;
644643
entryData.prefix = destpath;
645644
match = globber._makeAbs(match);
@@ -729,7 +728,7 @@ Archiver.prototype.glob = function(pattern, options, data) {
729728
}
730729

731730
function onGlobMatch(match){
732-
var entryData = _.extend({}, data);
731+
var entryData = Object.assign({}, data);
733732

734733
if (options.cwd) {
735734
entryData.name = match;

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"lib"
2222
],
2323
"engines": {
24-
"node": ">= 4"
24+
"node": ">= 6"
2525
},
2626
"scripts": {
2727
"test": "mocha --reporter dot",
@@ -33,7 +33,6 @@
3333
"async": "^2.0.0",
3434
"buffer-crc32": "^0.2.1",
3535
"glob": "^7.0.0",
36-
"lodash.assign": "^4.2.0",
3736
"readable-stream": "^2.0.0",
3837
"tar-stream": "^1.5.0",
3938
"zip-stream": "^1.2.0"

test/helpers/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function adjustDateByOffset(d, offset) {
2121
module.exports.adjustDateByOffset = adjustDateByOffset;
2222

2323
function binaryBuffer(n) {
24-
var buffer = new Buffer(n);
24+
var buffer = Buffer.alloc(n);
2525

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

38-
var buf = new Buffer(size);
38+
var buf = Buffer.alloc(size);
3939

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

0 commit comments

Comments
 (0)