Skip to content

Commit

Permalink
Merge pull request #2 from kadirahq/fix-filter-crash
Browse files Browse the repository at this point in the history
Fix filter crash
  • Loading branch information
Muhammed Thanish authored Jun 10, 2016
2 parents 4329c78 + 6f002ad commit a0e2c75
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
6 changes: 2 additions & 4 deletions dist/modules/ui/libs/filters.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use strict';
"use strict";

Object.defineProperty(exports, "__esModule", {
value: true
Expand All @@ -10,8 +10,6 @@ function storyFilter(stories, filter, selectedKind) {

return stories.filter(function (kindInfo) {
if (kindInfo.kind === selectedKind) return true;

var regExp = new RegExp(filter, 'ig');
return kindInfo.kind.match(regExp);
return kindInfo.kind.toLocaleLowerCase().indexOf(filter) >= 0;
});
}
4 changes: 1 addition & 3 deletions src/modules/ui/libs/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ export function storyFilter(stories, filter, selectedKind) {

return stories.filter((kindInfo) => {
if (kindInfo.kind === selectedKind) return true;

const regExp = new RegExp(filter, 'ig');
return kindInfo.kind.match(regExp);
return kindInfo.kind.toLocaleLowerCase().indexOf(filter) >= 0;
});
}

0 comments on commit a0e2c75

Please sign in to comment.