🐛 App > Add support to Typescript files
This commit is contained in:
+6
-4
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user