[Pkg-javascript-commits] [node-zip-stream] 04/05: add patch for replacing lodash.defaults with utils.merge

Andrew Kelley andrewrk-guest at moszumanska.debian.org
Tue Jul 1 18:14:14 UTC 2014


This is an automated email from the git hooks/post-receive script.

andrewrk-guest pushed a commit to branch master
in repository node-zip-stream.

commit 1d7a94af724fa5acc56138196e8bec7afce69ad4
Author: Andrew Kelley <superjoe30 at gmail.com>
Date:   Tue Jul 1 18:12:10 2014 +0000

    add patch for replacing lodash.defaults with utils.merge
---
 debian/patches/series            |  1 +
 debian/patches/utils-merge.patch | 95 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 96 insertions(+)

diff --git a/debian/patches/series b/debian/patches/series
index d7678e3..e228dbc 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 readable_stream.patch
+utils-merge.patch
diff --git a/debian/patches/utils-merge.patch b/debian/patches/utils-merge.patch
new file mode 100644
index 0000000..d95167d
--- /dev/null
+++ b/debian/patches/utils-merge.patch
@@ -0,0 +1,95 @@
+Description: use utils-merge instead of lodash.defaults
+ lodash.defaults has many subdependencies yet utils-merge does the same job.
+Author: Andrew Kelley <superjoe30 at gmail.com>
+Forwarded: https://github.com/ctalkington/node-zip-stream/pull/11
+Last-Update: 2014-07-01
+
+--- node-zip-stream-0.3.5.orig/lib/util/index.js
++++ node-zip-stream-0.3.5/lib/util/index.js
+@@ -11,8 +11,6 @@ var path = require('path');
+ var Stream = require('stream').Stream;
+ var PassThrough = require('stream').PassThrough;
+ 
+-var loDefaults = require('lodash.defaults');
+-
+ var util = module.exports = {};
+ 
+ util.debug = require('debug');
+@@ -42,14 +40,6 @@ util.dateify = function(dateish) {
+   return dateish;
+ };
+ 
+-// this is slightly different from lodash version
+-util.defaults = function(object, source, guard) {
+-  var args = arguments;
+-  args[0] = args[0] || {};
+-
+-  return loDefaults.apply(null, args);
+-};
+-
+ util.dosDateTime = function(d, utc) {
+   d = (d instanceof Date) ? d : util.dateify(d);
+   utc = utc || false;
+--- node-zip-stream-0.3.5.orig/lib/zip-stream.js
++++ node-zip-stream-0.3.5/lib/zip-stream.js
+@@ -13,6 +13,7 @@ var ChecksumStream = require('crc32-stre
+ var DeflateCRC32Stream = require('deflate-crc32-stream');
+ var headers = require('./headers');
+ var util = require('./util');
++var merge = require('utils-merge');
+ 
+ var debug = util.debug('zip-stream:instance');
+ var debugEntry = util.debug('zip-stream:entry');
+@@ -24,12 +25,12 @@ var ZipStream = module.exports = functio
+ 
+   debug('init');
+ 
+-  options = this.options = util.defaults(options, {
++  options = this.options = merge({
+     highWaterMark: 1024 * 1024,
+     comment: '',
+     forceUTC: false,
+     store: false
+-  });
++  }, options || {});
+ 
+   if (typeof options.zlib !== 'object') {
+     options.zlib = {};
+@@ -168,13 +169,13 @@ ZipStream.prototype._newProcessStream =
+ };
+ 
+ ZipStream.prototype._normalizeFileData = function(data) {
+-  data = util.defaults(data, {
++  data = merge({
+     type: 'file',
+     name: null,
+     date: null,
+     store: this.options.store,
+     comment: ''
+-  });
++  }, data);
+ 
+   var isDir = data.type === 'directory';
+ 
+--- node-zip-stream-0.3.5.orig/test/util.js
++++ node-zip-stream-0.3.5/test/util.js
+@@ -51,19 +51,6 @@ describe('utils', function() {
+     });
+   });
+ 
+-  describe('defaults(object, source, guard)', function() {
+-    it('should default when object key is missing', function() {
+-      var actual = utils.defaults({ value1: true }, {
+-        value2: true
+-      });
+-
+-      assert.deepEqual(actual, {
+-        value1: true,
+-        value2: true
+-      });
+-    });
+-  });
+-
+   describe('dosDateTime(date, utc)', function() {
+     it('should convert date into its DOS representation', function() {
+       assert.equal(utils.dosDateTime(testDate, true), testDateDosUTC);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-zip-stream.git



More information about the Pkg-javascript-commits mailing list