Skip to content

Commit

Permalink
use a ternary
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Oct 5, 2021
1 parent 89d6f84 commit 0a548f9
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions js/src/util/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,19 +312,11 @@ const getNextActiveElement = (list, activeElement, shouldGetNext, isCycleAllowed
}

const getWindow = () => {
if (typeof window !== 'undefined') {
return window
}

return {}
return typeof window !== 'undefined' ? window : {}
}

const getDocument = () => {
if (typeof document !== 'undefined') {
return document
}

return {}
return typeof document !== 'undefined' ? document : {}
}

export {
Expand Down

0 comments on commit 0a548f9

Please sign in to comment.