🐛 App > Add support to Typescript files

This commit is contained in:
brunosimon
2019-01-04 21:42:26 +01:00
parent cc54e55732
commit fdbcac2173
16 changed files with 75 additions and 43 deletions
+6 -4
View File
@@ -151,14 +151,15 @@ class Watcher
{
// Set up
const relativePath = _path.replace(this.path, '.')
const mimeType = mime.lookup(relativePath)
const mimeType = mime.getType(relativePath)
const extension = path.extname(relativePath)
const file = {}
file.path = relativePath
file.canRead = true
// Test mime type
if(mimeType.match(/^(audio)|(video)|(image)/))
if(mimeType.match(/^(audio)|(video)|(image)/) && extension !== '.ts')
{
file.canRead = false
}
@@ -211,14 +212,15 @@ class Watcher
{
// Set up
const relativePath = _path.replace(this.path, '.')
const mimeType = mime.lookup(relativePath)
const mimeType = mime.getType(relativePath)
const extension = path.extname(relativePath)
const file = {}
file.path = relativePath
file.canRead = true
// Test mime type
if(mimeType.match(/^(audio)|(video)|(image)/))
if(mimeType.match(/^(audio)|(video)|(image)/) && extension !== '.ts')
{
file.canRead = false
}