Excluse .js.map when scanning models/ directory
authorChocobozzz <florian.bigard@gmail.com>
Sat, 24 Jun 2017 08:30:23 +0000 (10:30 +0200)
committerChocobozzz <florian.bigard@gmail.com>
Sat, 24 Jun 2017 08:30:23 +0000 (10:30 +0200)
server/initializers/database.ts

index 47604c6b014c2aa9a66b13ae545e21af46d48b42..705dec6da402300c68ad30fab14c3f632a728718 100644 (file)
@@ -109,8 +109,9 @@ function getModelFiles (modelDirectory: string, callback: (err: Error, filePaths
     if (err) throw err
 
     const directories = files.filter(function (directory) {
-      // For all models but not utils.js
+      // Find directories
       if (
+        directory.endsWith('.js.map') ||
         directory === 'index.js' || directory === 'index.ts' ||
         directory === 'utils.js' || directory === 'utils.ts'
       ) return false