Skip to content

Commit aa52b74

Browse files
bekzodGaurav0
authored andcommitted
match => test
1 parent b7b21bf commit aa52b74

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

app/mixins/files.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default Ember.Mixin.create({
1010

1111
createFile(filePath, fileProperties, fileColumn=1) {
1212
if (filePath) {
13-
if(this.hasPath(filePath)) {
13+
if (this.hasPath(filePath)) {
1414
alert(`A file with the name ${filePath} already exists`);
1515
return;
1616
}
@@ -32,8 +32,8 @@ export default Ember.Mixin.create({
3232
*/
3333
isPathInvalid(type, path){
3434
let errorMsg = null;
35-
if (type.match(/^component/)) {
36-
if (!path.match(/[^\/]+-[^\/]+(\/(component\.js|template\.hbs))?$/)) {
35+
if (/^component/.test(type)) {
36+
if (!/[^\/]+-[^\/]+(\/(component\.js|template\.hbs))?$/.test(path)) {
3737
errorMsg = ErrorMessages.componentsNeedHyphens;
3838
}
3939
}
@@ -77,7 +77,7 @@ export default Ember.Mixin.create({
7777
renameFile(file) {
7878
let filePath = prompt('File path', file.get('filePath'));
7979
if (filePath) {
80-
if(this.get('model.files').findBy('filePath', filePath)) {
80+
if (this.get('model.files').findBy('filePath', filePath)) {
8181
alert(`A file with the name ${filePath} already exists`);
8282
return;
8383
}

0 commit comments

Comments
 (0)