Skip to content
This repository was archived by the owner on Feb 25, 2022. It is now read-only.

Commit baa9637

Browse files
Merronskjspizziri
authored andcommitted
fix(Discoverable): Prevent model discovery from including non-js files - Update filter for filename search
1 parent 030614c commit baa9637

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Discoverable.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class Discoverable {
6363
if(typeof this.matcher === 'function' && this.matcher(file) === true) {
6464
this._log("debug", "Discovered path: " + path);
6565
return path;
66-
} else if((file.indexOf(".") !== 0) && (file.indexOf(".model.js") > 0)) {
66+
} else if(/^[^.].*?\.model\.js$/.test(file)) {
6767
this._log("debug", "Discovered path: " + path);
6868
return path;
6969
}

0 commit comments

Comments
 (0)