From 2cdb935f1df8fdebf0321b98cbd9994d371fd5ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Fri, 24 Jul 2020 11:21:26 -0400 Subject: [PATCH] feat: remove file.isFileTypeAllowed --- src/file.js | 5 ----- test/uploads.js | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/file.js b/src/file.js index cb384ec64a..2631bdd47f 100644 --- a/src/file.js +++ b/src/file.js @@ -53,11 +53,6 @@ file.base64ToLocal = async function (imageData, uploadPath) { return uploadPath; }; -file.isFileTypeAllowed = async function (path) { - winston.warn('[deprecated] file.isFileTypeAllowed is deprecated, use image.isFileTypeAllowed'); - await require('./image').isFileTypeAllowed(path); -}; - // https://stackoverflow.com/a/31205878/583363 file.appendToFileName = function (filename, string) { const dotIndex = filename.lastIndexOf('.'); diff --git a/test/uploads.js b/test/uploads.js index ec8618f3f6..ab47929284 100644 --- a/test/uploads.js +++ b/test/uploads.js @@ -162,7 +162,7 @@ describe('Upload Controllers', function () { }); it('should fail if file is not an image', function (done) { - file.isFileTypeAllowed(path.join(__dirname, '../test/files/notanimage.png'), function (err) { + image.isFileTypeAllowed(path.join(__dirname, '../test/files/notanimage.png'), function (err) { assert.equal(err.message, 'Input file contains unsupported image format'); done(); });