Skip to content

Commit

Permalink
✨ Add modelsMatch option
Browse files Browse the repository at this point in the history
  • Loading branch information
saschagehlich committed Oct 13, 2017
1 parent d77c2d6 commit 6a2db68
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/sequenice.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ export default class Sequenize {
modelsDirectory: null,
modelsAttacher: global,
getterPrefix: '_get',
setterPrefix: '_set'
setterPrefix: '_set',
modelsMatch: /\.(js|coffee)$/i
})

this._loadModels()
Expand Down Expand Up @@ -60,7 +61,9 @@ export default class Sequenize {

const files = globule.find('**/*', {
cwd: modelsDirectory,
filter: 'isFile'
filter: f => {
return fs.statSync(f).isFile() && this._options.modelsMatch.test(f)
}
})

files.forEach((file) => {
Expand Down

0 comments on commit 6a2db68

Please sign in to comment.