Skip to content

Commit

Permalink
updated typecheck for regex and remove FlowFixMe
Browse files Browse the repository at this point in the history
  • Loading branch information
ro-savage committed Mar 3, 2017
1 parent b2e1731 commit 92bd400
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/jest-haste-map/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -689,9 +689,8 @@ class HasteMap extends EventEmitter {
*/
_ignore(filePath: Path): boolean {
const ignorePattern = this._options.ignorePattern;
const ignoreMatched =
Object.prototype.toString.call(ignorePattern) === '[object RegExp]'
? ignorePattern.test(filePath) // $FlowFixMe
const ignoreMatched = ignorePattern instanceof RegExp
? ignorePattern.test(filePath)
: ignorePattern(filePath);

return ignoreMatched ||
Expand Down

0 comments on commit 92bd400

Please sign in to comment.