From 8100afaaef6eda7066883779ac0cc5b147e18a12 Mon Sep 17 00:00:00 2001 From: Evan Tahler Date: Mon, 18 Nov 2019 13:00:27 -0800 Subject: [PATCH] fixup checks to load TS files, but not .d.ts files --- classes/sequelize.js | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/classes/sequelize.js b/classes/sequelize.js index f0ee2f90..0411b83c 100644 --- a/classes/sequelize.js +++ b/classes/sequelize.js @@ -40,7 +40,7 @@ module.exports = class SequelizePlugin { } ], path: dir, - pattern: /\.(js|ts)$/ + pattern: /(\.js|.{2,*}\.ts)$/ } }) ) @@ -54,7 +54,7 @@ module.exports = class SequelizePlugin { if (fs.statSync(filename).isDirectory()) { return this.importModelsFromDirectory(filename) } - if (path.extname(file) !== '.js' && path.extname(file) !== '.ts') return + if ((path.extname(file) !== '.js' && path.extname(file) !== '.ts') || file.indexOf('.d.ts') > 0) return const nameParts = file.split('/') const name = nameParts[nameParts.length - 1].split('.')[0] const modelFunc = currySchemaFunc(require(filename)) diff --git a/package.json b/package.json index e3fe66c2..8f6bdf40 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "name": "ah-sequelize-plugin", "license": "MIT", "description": "Use Sequelize in ActionHero", - "version": "1.3.1", + "version": "1.3.2", "homepage": "http://actionherojs.com", "repository": { "type": "git",