-
Notifications
You must be signed in to change notification settings - Fork 234
Conversation
e968f35
to
c458681
Compare
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.
Looks good, just have a couple nits.
test/Rule.js
Outdated
@@ -131,6 +131,15 @@ test('toConfig with values', t => { | |||
}); | |||
}); | |||
|
|||
test('toConfig with test function', t => { | |||
const rule = new Rule(); | |||
const test = s => s.indexOf('.js') >= 0; |
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.
Can you make this:
const test = s => s.includes('.js');
src/Rule.js
Outdated
@@ -87,7 +87,11 @@ const Rule = Orderable( | |||
} | |||
|
|||
if (!omit.includes('test') && 'test' in obj) { | |||
this.test(obj.test instanceof RegExp ? obj.test : new RegExp(obj.test)); | |||
this.test( | |||
obj.test instanceof RegExp || obj.test instanceof Function |
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.
Can you change obj.test instanceof Function
to typeof obj.test === 'function'
?
c458681
to
5e23771
Compare
5e23771
to
3f1b951
Compare
@eliperelman Thanks for your advice, all changes applied. |
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.
Looks great, thank you so much!
Published in v6.1.0 :-) |
Fix #171.