소스 검색

Simplified code.

Maciej Bukowski 7 년 전
부모
커밋
e2291ca55f
1개의 변경된 파일10개의 추가작업 그리고 6개의 파일을 삭제
  1. 10 6
      packages/ckeditor5-utils/src/dom/iswindow.js

+ 10 - 6
packages/ckeditor5-utils/src/dom/iswindow.js

@@ -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;
 }