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

Commit 7fe4741

Browse files
committed
Removed useless if
1 parent c966125 commit 7fe4741

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

Diff for: lib/ext/match.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* MIT Licensed
66
*/
77

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

1111
export default function(should, Assertion) {
@@ -76,10 +76,6 @@ export default function(should, Assertion) {
7676
if (typeof this.obj == 'string') {
7777

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

8581
var notMatchedProps = [], matchedProps = [];

Diff for: test/ext/match.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ describe('match', function() {
4646

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

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

5656
it('test match(function)', function() {

0 commit comments

Comments
 (0)