File tree Expand file tree Collapse file tree 1 file changed +2
-17
lines changed
Expand file tree Collapse file tree 1 file changed +2
-17
lines changed Original file line number Diff line number Diff line change 22const fs = require ( 'fs' )
33const path = require ( 'path' )
44const bodyParser = require ( 'body-parser' )
5+ const mime = require ( 'mime-types' )
56
67exports . isSQLite = function isSQLite ( sequelize ) {
78 return sequelize . options . dialect === 'sqlite'
89}
910
1011exports . getImageMimeType = function getImageMimeType ( imagePath ) {
11- const fileExtension = / [ ^ . ] + $ / . exec ( imagePath )
12-
13- switch ( fileExtension [ 0 ] ) {
14- case 'bmp' :
15- return 'image/bmp'
16- case 'gif' :
17- return 'image/gif'
18- case 'jpg' :
19- case 'jpeg' :
20- return 'image/jpeg'
21- case 'png' :
22- return 'image/png'
23- case 'tiff' :
24- return 'image/tiff'
25- default :
26- return undefined
27- }
12+ return mime . contentType ( path . extname ( imagePath ) )
2813}
2914
3015exports . isRevealTheme = function isRevealTheme ( theme ) {
You can’t perform that action at this time.
0 commit comments