Skip to content
This repository has been archived by the owner on Nov 4, 2020. It is now read-only.

Commit

Permalink
Removed useless if
Browse files Browse the repository at this point in the history
  • Loading branch information
btd committed Aug 4, 2016
1 parent c966125 commit 7fe4741
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
6 changes: 1 addition & 5 deletions lib/ext/match.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* MIT Licensed
*/

import { format, forEach, isIndexable, formatProp, some } from '../util';
import { format, forEach, formatProp, some } from '../util';
import eql from 'should-equal';

export default function(should, Assertion) {
Expand Down Expand Up @@ -76,10 +76,6 @@ export default function(should, Assertion) {
if (typeof this.obj == 'string') {

this.assert(other.exec(this.obj));
} else if (isIndexable(this.obj)) {
forEach(this.obj, function(item) {
this.assert(other.exec(item));// should we try to convert to String and exec?
}, this);
} else if (null != this.obj && typeof this.obj == 'object') {

var notMatchedProps = [], matchedProps = [];
Expand Down
4 changes: 2 additions & 2 deletions test/ext/match.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ describe('match', function() {

err(function() {
['a', 'b', 'c'].should.not.match(/[a-z]/);
}, "expected Array [ 'a', 'b', 'c' ] not to match /[a-z]/ (false negative fail)");
}, "expected Array [ 'a', 'b', 'c' ] not to match /[a-z]/\n matched properties: '0', '1', '2' (false negative fail)");

err(function() {
['a', 'b', 'c'].should.match(/[d-z]/);
}, "expected Array [ 'a', 'b', 'c' ] to match /[d-z]/");
}, "expected Array [ 'a', 'b', 'c' ] to match /[d-z]/\n not matched properties: \'0\' (\'a\'), \'1\' (\'b\'), \'2\' (\'c\')");
});

it('test match(function)', function() {
Expand Down

0 comments on commit 7fe4741

Please sign in to comment.