-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support dot file #24
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module.exports = function (app) { | ||
return { | ||
load: true, | ||
app: app | ||
}; | ||
}; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ describe('mods.test.js', function() { | |
it('should get mods', function() { | ||
var dir = join(fixtures, 'services'); | ||
var sortFn = function(x, y){ | ||
return x.fullpath < y.fullpath; | ||
return x.fullpath < y.fullpath ? 1 : -1; | ||
}; | ||
var mods = getMods(dir).sort(sortFn); | ||
mods.should.eql([{ | ||
|
@@ -40,28 +40,35 @@ describe('mods.test.js', function() { | |
}, { | ||
fullpath: dir + '/userProfile.js', | ||
properties: ['userProfile'] | ||
}, { | ||
fullpath: dir + '/dot.file.js', | ||
properties: ['dot.file'] | ||
}, { | ||
fullpath: dir + '/dot.dir/a.js', | ||
properties: ['dot.dir', 'a'] | ||
}].sort(sortFn)); | ||
}); | ||
|
||
it('should throw when directory contains dot', function() { | ||
(function() { | ||
getMods(join(fixtures, 'error/dotdir')); | ||
}).should.throw('dot.dir is not match /^[a-z][a-z0-9_-]*$/gi in dot.dir/a.js'); | ||
}); | ||
// when support dot file, this case will remove; | ||
// it('should throw when directory contains dot', function() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 把这个测试用例改对吧, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. dot.dir也会变成同步支持. 现在好像没法区分是file还是dir |
||
// (function() { | ||
// getMods(join(fixtures, 'error/dotdir')); | ||
// }).should.throw('dot.dir is not match /^[a-z][a-z0-9_-]*$/gi in dot.dir/a.js'); | ||
// }); | ||
|
||
it('should throw when directory starts with underscore', function() { | ||
(function() { | ||
getMods(join(fixtures, 'error/underscore-dir')); | ||
}).should.throw('_underscore is not match /^[a-z][a-z0-9_-]*$/gi in _underscore/a.js'); | ||
}).should.throw('_underscore is not match /^[a-z][a-z\\.0-9_-]*$/gi in _underscore/a.js'); | ||
(function() { | ||
getMods(join(fixtures, 'error/underscore-file-in-dir')); | ||
}).should.throw('_a is not match /^[a-z][a-z0-9_-]*$/gi in dir/_a.js'); | ||
}).should.throw('_a is not match /^[a-z][a-z\\.0-9_-]*$/gi in dir/_a.js'); | ||
}); | ||
|
||
it('should throw when file starts with underscore', function() { | ||
(function() { | ||
getMods(join(fixtures, 'error/underscore-file')); | ||
}).should.throw('_private is not match /^[a-z][a-z0-9_-]*$/gi in _private.js'); | ||
}).should.throw('_private is not match /^[a-z][a-z\\.0-9_-]*$/gi in _private.js'); | ||
}); | ||
|
||
}); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
property.replace(/[_-][a-z]/ig 这个需要将 . 改成驼峰么
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
感觉一般来说都是用:
name.postfix.js
这样的,保留比较合理?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我也是想保留 user.sqlmap.js 的模式; 感觉直观一些;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
比较奇怪吧,不能用属性访问
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个还搞么?