Browse Source

Use tripple equal for consistency.

Piotrek Koszuliński 5 years ago
parent
commit
1ada9d0189

+ 1 - 1
packages/ckeditor5-engine/src/model/documentfragment.js

@@ -133,7 +133,7 @@ export default class DocumentFragment {
 	 * @returns {Boolean}
 	 */
 	is( type ) {
-		return type == 'documentFragment' || type == 'model:documentFragment';
+		return type === 'documentFragment' || type === 'model:documentFragment';
 	}
 
 	/**

+ 1 - 1
packages/ckeditor5-engine/src/model/documentselection.js

@@ -382,7 +382,7 @@ export default class DocumentSelection {
 	 * @returns {Boolean}
 	 */
 	is( type ) {
-		return type == 'selection' ||
+		return type === 'selection' ||
 			type == 'model:selection' ||
 			type == 'documentSelection' ||
 			type == 'model:documentSelection';

+ 2 - 2
packages/ckeditor5-engine/src/model/liveposition.js

@@ -80,9 +80,9 @@ export default class LivePosition extends Position {
 	 * @returns {Boolean}
 	 */
 	is( type ) {
-		return type == 'livePosition' || type == 'model:livePosition' ||
+		return type === 'livePosition' || type === 'model:livePosition' ||
 			// From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
-			type == 'position' || type == 'model:position';
+			type == 'position' || type === 'model:position';
 	}
 
 	/**

+ 2 - 2
packages/ckeditor5-engine/src/model/liverange.js

@@ -57,9 +57,9 @@ export default class LiveRange extends Range {
 	 * @returns {Boolean}
 	 */
 	is( type ) {
-		return type == 'liveRange' || type == 'model:liveRange' ||
+		return type === 'liveRange' || type === 'model:liveRange' ||
 			// From super.is(). This is highly utilised method and cannot call super. See ckeditor/ckeditor5#6529.
-			type == 'range' || type == 'model:range';
+			type == 'range' || type === 'model:range';
 	}
 
 	/**

+ 1 - 1
packages/ckeditor5-engine/src/model/markercollection.js

@@ -463,7 +463,7 @@ class Marker {
 	 * @returns {Boolean}
 	 */
 	is( type ) {
-		return type == 'marker' || type == 'model:marker';
+		return type === 'marker' || type === 'model:marker';
 	}
 
 	/**

+ 1 - 1
packages/ckeditor5-engine/src/model/position.js

@@ -540,7 +540,7 @@ export default class Position {
 	 * @returns {Boolean}
 	 */
 	is( type ) {
-		return type == 'position' || type == 'model:position';
+		return type === 'position' || type === 'model:position';
 	}
 
 	/**

+ 1 - 1
packages/ckeditor5-engine/src/model/range.js

@@ -158,7 +158,7 @@ export default class Range {
 	 * @returns {Boolean}
 	 */
 	is( type ) {
-		return type == 'range' || type == 'model:range';
+		return type === 'range' || type === 'model:range';
 	}
 
 	/**

+ 1 - 1
packages/ckeditor5-engine/src/model/selection.js

@@ -632,7 +632,7 @@ export default class Selection {
 	 * @returns {Boolean}
 	 */
 	is( type ) {
-		return type == 'selection' || type == 'model:selection';
+		return type === 'selection' || type === 'model:selection';
 	}
 
 	/**

+ 1 - 1
packages/ckeditor5-engine/src/model/textproxy.js

@@ -178,7 +178,7 @@ export default class TextProxy {
 	 * @returns {Boolean}
 	 */
 	is( type ) {
-		return type == 'textProxy' || type == 'model:textProxy';
+		return type === 'textProxy' || type === 'model:textProxy';
 	}
 
 	/**

+ 2 - 2
packages/ckeditor5-engine/src/model/writer.js

@@ -1360,14 +1360,14 @@ export default class Writer {
 			const markerRange = marker.getRange();
 			let isAffected = false;
 
-			if ( type == 'move' ) {
+			if ( type === 'move' ) {
 				isAffected =
 					positionOrRange.containsPosition( markerRange.start ) ||
 					positionOrRange.start.isEqual( markerRange.start ) ||
 					positionOrRange.containsPosition( markerRange.end ) ||
 					positionOrRange.end.isEqual( markerRange.end );
 			} else {
-				// if type == 'merge'.
+				// if type === 'merge'.
 				const elementBefore = positionOrRange.nodeBefore;
 				const elementAfter = positionOrRange.nodeAfter;
 

+ 1 - 1
packages/ckeditor5-engine/src/view/documentfragment.js

@@ -118,7 +118,7 @@ export default class DocumentFragment {
 	 * @returns {Boolean}
 	 */
 	is( type ) {
-		return type == 'documentFragment' || type == 'view:documentFragment';
+		return type === 'documentFragment' || type === 'view:documentFragment';
 	}
 
 	/**

+ 1 - 1
packages/ckeditor5-engine/src/view/documentselection.js

@@ -292,7 +292,7 @@ export default class DocumentSelection {
 	 * @returns {Boolean}
 	 */
 	is( type ) {
-		return type == 'selection' ||
+		return type === 'selection' ||
 			type == 'documentSelection' ||
 			type == 'view:selection' ||
 			type == 'view:documentSelection';

+ 1 - 1
packages/ckeditor5-engine/src/view/position.js

@@ -222,7 +222,7 @@ export default class Position {
 	 * @returns {Boolean}
 	 */
 	is( type ) {
-		return type == 'position' || type == 'view:position';
+		return type === 'position' || type === 'view:position';
 	}
 
 	/**

+ 1 - 1
packages/ckeditor5-engine/src/view/range.js

@@ -449,7 +449,7 @@ export default class Range {
 	 * @returns {Boolean}
 	 */
 	is( type ) {
-		return type == 'range' || type == 'view:range';
+		return type === 'range' || type === 'view:range';
 	}
 
 	/**

+ 1 - 1
packages/ckeditor5-engine/src/view/selection.js

@@ -590,7 +590,7 @@ export default class Selection {
 	 * @returns {Boolean}
 	 */
 	is( type ) {
-		return type == 'selection' || type == 'view:selection';
+		return type === 'selection' || type === 'view:selection';
 	}
 
 	/**

+ 1 - 1
packages/ckeditor5-engine/src/view/text.js

@@ -60,7 +60,7 @@ export default class Text extends Node {
 	 * @returns {Boolean}
 	 */
 	is( type ) {
-		return type == 'text' || type == 'view:text' || super.is( type );
+		return type === 'text' || type === 'view:text' || super.is( type );
 	}
 
 	/**

+ 1 - 1
packages/ckeditor5-engine/src/view/textproxy.js

@@ -156,7 +156,7 @@ export default class TextProxy {
 	 * @returns {Boolean}
 	 */
 	is( type ) {
-		return type == 'textProxy' || type == 'view:textProxy';
+		return type === 'textProxy' || type === 'view:textProxy';
 	}
 
 	/**