Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Simplified code.
Browse files Browse the repository at this point in the history
  • Loading branch information
ma2ciek committed Jul 5, 2018
1 parent 49c694b commit 4ced195
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/dom/iswindow.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,15 @@
export default function isWindow( obj ) {
const stringifiedObject = Object.prototype.toString.apply( obj );

return (
// Returns `true` for the `window` object in browser environments.
stringifiedObject == '[object Window]' ||
// Returns `true` for the `window` object in browser environments.
if ( stringifiedObject == '[object Window]' ) {
return true;
}

// Returns `true` for the `window` object in the Electron environment.
stringifiedObject == '[object global]'
);
// Returns `true` for the `window` object in the Electron environment.
if ( stringifiedObject == '[object global]' ) {
return true;
}

return false;
}

0 comments on commit 4ced195

Please sign in to comment.