Bump dependencies

Bumping eslint & configs meant making some linting fixes

For future reference, the `xmlhttprequest-ssl` library must be of equal versioning to the one in `engine.io-client`, otherwise it won't be deduped which causes the socket.io tests to fail
This commit is contained in:
Peter Jaszkowiak
2017-10-01 16:19:10 -06:00
committed by Julian Lam
parent 47bbe846cb
commit da9da8190f
24 changed files with 96 additions and 97 deletions

View File

@@ -89,7 +89,7 @@ uploadsController.uploadLogo = function (req, res, next) {
uploadsController.uploadSound = function (req, res, next) {
var uploadedFile = req.files.files[0];
var mimeType = mime.lookup(uploadedFile.name);
var mimeType = mime.getType(uploadedFile.name);
if (!/^audio\//.test(mimeType)) {
return next(Error('[[error:invalid-data]]'));
}

View File

@@ -45,7 +45,7 @@ file.saveFileToLocal = function (filename, folder, tempPath, callback) {
};
file.base64ToLocal = function (imageData, uploadPath, callback) {
var buffer = new Buffer(imageData.slice(imageData.indexOf('base64') + 7), 'base64');
var buffer = Buffer.from(imageData.slice(imageData.indexOf('base64') + 7), 'base64');
uploadPath = path.join(nconf.get('upload_path'), uploadPath);
fs.writeFile(uploadPath, buffer, {
@@ -141,7 +141,7 @@ file.linkDirs = function linkDirs(sourceDir, destDir, callback) {
file.typeToExtension = function (type) {
var extension;
if (type) {
extension = '.' + mime.extension(type);
extension = '.' + mime.getExtension(type);
}
return extension;
};

View File

@@ -240,7 +240,7 @@ Flags.validate = function (payload, callback) {
}
var minimumReputation = utils.isNumber(meta.config['privileges:flag']) ? parseInt(meta.config['privileges:flag'], 10) : 1;
// Check if reporter meets rep threshold (or can edit the target post, in which case threshold does not apply)
// Check if reporter meets rep threshold (or can edit the target post, in which case threshold does not apply)
if (!editable.flag && parseInt(data.reporter.reputation, 10) < minimumReputation) {
return callback(new Error('[[error:not-enough-reputation-to-flag]]'));
}
@@ -256,7 +256,7 @@ Flags.validate = function (payload, callback) {
}
var minimumReputation = utils.isNumber(meta.config['privileges:flag']) ? parseInt(meta.config['privileges:flag'], 10) : 1;
// Check if reporter meets rep threshold (or can edit the target user, in which case threshold does not apply)
// Check if reporter meets rep threshold (or can edit the target user, in which case threshold does not apply)
if (!editable && parseInt(data.reporter.reputation, 10) < minimumReputation) {
return callback(new Error('[[error:not-enough-reputation-to-flag]]'));
}

View File

@@ -26,7 +26,7 @@ module.exports = function (Groups) {
var tempPath = data.file ? data.file : '';
var url;
var type = data.file ? mime.lookup(data.file) : 'image/png';
var type = data.file ? mime.getType(data.file) : 'image/png';
async.waterfall([
function (next) {

View File

@@ -141,7 +141,7 @@ image.writeImageDataToTempFile = function (imageData, callback) {
var filepath = path.join(os.tmpdir(), filename + extension);
var buffer = new Buffer(imageData.slice(imageData.indexOf('base64') + 7), 'base64');
var buffer = Buffer.from(imageData.slice(imageData.indexOf('base64') + 7), 'base64');
fs.writeFile(filepath, buffer, {
encoding: 'base64',

View File

@@ -282,9 +282,9 @@ function buildCSS(data, callback) {
processImportFrom: ['local'],
}),
] : [autoprefixer]).process(lessOutput.css).then(function (result) {
callback(null, { code: result.css });
process.nextTick(callback, null, { code: result.css });
}, function (err) {
callback(err);
process.nextTick(callback, err);
});
});
}

View File

@@ -39,8 +39,7 @@ module.exports = function (Plugins) {
(Plugins.deprecatedHooks[data.hook] ?
'please use `' + Plugins.deprecatedHooks[data.hook] + '` instead.' :
'there is no alternative.'
)
);
));
} else {
// handle hook's startsWith, i.e. action:homepage.get
var parts = data.hook.split(':');
@@ -61,7 +60,7 @@ module.exports = function (Plugins) {
if (memo && memo[prop]) {
return memo[prop];
}
// Couldn't find method by path, aborting
// Couldn't find method by path, aborting
return null;
}, Plugins.libraries[data.id]);

View File

@@ -35,7 +35,7 @@ module.exports = function (Topics) {
var extension = path.extname(data.thumb);
if (!extension) {
extension = '.' + mime.extension(type);
extension = '.' + mime.getExtension(type);
}
filename = Date.now() + '-topic-thumb' + extension;
pathToUpload = path.join(nconf.get('upload_path'), 'files', filename);

View File

@@ -28,7 +28,7 @@ module.exports = function (User) {
var uploadSize = parseInt(meta.config.maximumProfileImageSize, 10) || 256;
var size = res.headers['content-length'];
var type = res.headers['content-type'];
var extension = mime.extension(type);
var extension = mime.getExtension(type);
if (['png', 'jpeg', 'jpg', 'gif'].indexOf(extension) === -1) {
return callback(new Error('[[error:invalid-image-extension]]'));