Skip to content

Commit

Permalink
fix(parser): resolve issues with array detection (#516)
Browse files Browse the repository at this point in the history
- this change resolves issues with Next.js middlewares
  • Loading branch information
connor-baer committed Nov 13, 2023
1 parent f094114 commit b86bce1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class Parser {
return _browser.test(this);
}

if (_browser.test instanceof Array) {
if (Array.isArray(_browser.test)) {
return _browser.test.some(condition => this.test(condition));
}

Expand Down Expand Up @@ -170,7 +170,7 @@ class Parser {
return _os.test(this);
}

if (_os.test instanceof Array) {
if (Array.isArray(_os.test)) {
return _os.test.some(condition => this.test(condition));
}

Expand Down Expand Up @@ -246,7 +246,7 @@ class Parser {
return _platform.test(this);
}

if (_platform.test instanceof Array) {
if (Array.isArray(_platform.test)) {
return _platform.test.some(condition => this.test(condition));
}

Expand Down Expand Up @@ -297,7 +297,7 @@ class Parser {
return _engine.test(this);
}

if (_engine.test instanceof Array) {
if (Array.isArray(_engine.test)) {
return _engine.test.some(condition => this.test(condition));
}

Expand Down

0 comments on commit b86bce1

Please sign in to comment.