Skip to content

Commit

Permalink
Merge pull request #7 from Ayc0/Ayc0/invalid-query
Browse files Browse the repository at this point in the history
In case of invalid query, fallback to 'not all'
  • Loading branch information
Ayc0 authored Jan 18, 2022
2 parents 5d36ed1 + ec298c5 commit 2e27b1c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ export const matchMedia: typeof window.matchMedia = (query: string) => {
try {
matches = match(query, state);
} catch (e) {
query = query.replace(/ /g, "_");
matches = match(query, state);
query = "not all";
matches = false;
}
return {
matches,
Expand Down

0 comments on commit 2e27b1c

Please sign in to comment.