Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to lodash 4.5.0 #27

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/read-stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function expectedError(request, error) {
*/
module.exports = function createReadStream(options) {

options = _.assign({
options = _.assignWith({
buffer: true,
read: true,
awsOptions: { },
Expand All @@ -53,13 +53,13 @@ module.exports = function createReadStream(options) {

// Select the appropriate S3 API call based on how the user
// wants the data.
var request = _.assign({ }, options.awsOptions, object);
var request = _.assignWith({ }, options.awsOptions, object);

function resolve(err, result) {
if (err) {
return callback(!expectedError(request, err) ? err : null);
} else {
return callback(null, _.assign({ }, object, result));
return callback(null, _.assignWith({ }, object, result));
}
}

Expand All @@ -68,7 +68,7 @@ module.exports = function createReadStream(options) {
} else if (options.read && !options.buffer) {
S3S.ReadStream(options.s3, request)
.on('open', function open(headers) {
resolve(null, _.assign(headers, { Body: this }));
resolve(null, _.assignWith(headers, { Body: this }));
})
.on('error', resolve)
.read(0); // Trigger initial read for open event
Expand Down
7 changes: 3 additions & 4 deletions lib/s3.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ function S3(options) {
this.options = options;
}


/**
* Fetch vinyl objects from S3 matching a specific set of glob patterns.
* This method behaves in much the same way as `gulp.src` does.
Expand All @@ -31,7 +30,7 @@ function S3(options) {
* @see gulp.src
*/
S3.src = function src(path, options) {
options = _.assign({ format: 'query' }, options);
options = _.assignWith({ format: 'query' }, options);
return S3G(path, options)
.pipe(readStream(options))
.pipe(vinylStream(options));
Expand All @@ -53,11 +52,11 @@ S3.dest = function dest(path, options) {


S3.prototype.src = function wrapSrc(path, options) {
return S3.src(path, _.assign({ }, this.options, options));
return S3.src(path, _.assignWith({ }, this.options, options));
};

S3.prototype.dest = function wrapDest(path, options) {
return S3.dest(path, _.assign({ }, this.options, options));
return S3.dest(path, _.assignWith({ }, this.options, options));
};

module.exports = S3;
2 changes: 1 addition & 1 deletion lib/vinyl-stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var _ = require('lodash'),
*/
module.exports = function createVinylStream(options) {

options = _.assign({
options = _.assignWith({
meta: true,
base: '',
cwd: process.cwd()
Expand Down
11 changes: 5 additions & 6 deletions lib/write-stream.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

'use strict';

var _ = require('lodash'),
Expand Down Expand Up @@ -31,7 +30,7 @@ var encodings = {
*/
module.exports = function createWriteStream(root, options) {

options = _.assign({
options = _.assignWith({
s3: new AWS.S3(),
awsOptions: { }
}, options);
Expand All @@ -44,7 +43,7 @@ module.exports = function createWriteStream(root, options) {
throw new TypeError();
}

_.assign(awsOptions, _.isString(root) ? url.urlToOptions(root) : root);
_.assignWith(awsOptions, _.isString(root) ? url.urlToOptions(root) : root);

if (!_.has(awsOptions, 'Bucket')) {
throw new TypeError();
Expand Down Expand Up @@ -81,7 +80,7 @@ module.exports = function createWriteStream(root, options) {
if (contentEncoding.length > 0 && !contentType) {
var last = _.chain(name.split('.'))
.dropRightWhile(function checkPart(ext) {
return _.contains(contentEncoding, encodings[ext]);
return _.includes(contentEncoding, encodings[ext]);
})
.last()
.value();
Expand All @@ -94,7 +93,7 @@ module.exports = function createWriteStream(root, options) {
contentType = mime.lookup(name);
}

var fileOptions = _.assign({ }, awsOptions, {
var fileOptions = _.assignWith({ }, awsOptions, {
Key: prefix + file.relative,
ContentType: contentType,
ContentEncoding: contentEncoding.join(',')
Expand All @@ -103,7 +102,7 @@ module.exports = function createWriteStream(root, options) {
if (!file.isNull()) {
// Use the new S3 streaming upload API; for more info see
// https://github.com/aws/aws-sdk-js/pull/427
s3.upload(_.assign(fileOptions, {
s3.upload(_.assignWith(fileOptions, {
Body: file.contents
}), _.pick(options, 'queueSize', 'partSize'), done);
} else {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"dependencies": {
"aws-sdk": "^2.1.23",
"lodash": "^3.9.3",
"lodash": "^4.5.0",
"mime": "^1.3.4",
"vinyl": "^0.5.0",
"through2": "^2.0.0",
Expand Down