Fix linting

This commit is contained in:
Jonathan Cremin 2018-06-02 18:07:00 +00:00
parent 553ba9db9a
commit bb5189c9ed
35 changed files with 157 additions and 866 deletions

34
lib/sniff.js Normal file
View file

@ -0,0 +1,34 @@
const extensions = {
jpg: 'image',
jpeg: 'image',
png: 'image',
gif: 'image',
bmp: 'image',
tiff: 'image',
psd: 'image',
mp3: 'audio',
m4a: 'audio',
ogg: 'audio',
flac: 'audio',
aac: 'audio',
mpg: 'video',
mkv: 'video',
avi: 'video',
divx: 'video',
mpeg: 'video',
flv: 'video',
mp4: 'video',
mov: 'video',
zip: 'archive',
gz: 'archive',
tgz: 'archive',
bz2: 'archive',
rar: 'archive',
};
export default (filename) => {
if (extensions[filename.split('.').pop().toLowerCase()]) {
return extensions[filename.split('.').pop().toLowerCase()];
}
return 'other';
};