Ver código fonte

use String#includes instead of String#indexOf

Gildas 7 anos atrás
pai
commit
41a8efbf04

+ 1 - 1
lib/frame-tree/frame-tree.js

@@ -217,7 +217,7 @@ this.frameTree = this.frameTree || (() => {
 			if (contentType) {
 				const matchContentType = contentType.toLowerCase().split(";");
 				mimeType = matchContentType[0].trim();
-				if (mimeType.indexOf("/") <= 0) {
+				if (!mimeType.includes("/")) {
 					mimeType = "text/html";
 				}
 				const charsetValue = matchContentType[1] && matchContentType[1].trim();

+ 1 - 1
lib/single-file/single-file-browser.js

@@ -101,7 +101,7 @@ this.SingleFileBrowser = this.SingleFileBrowser || (() => {
 		if (contentType) {
 			const matchContentType = contentType.toLowerCase().split(";");
 			contentType = matchContentType[0].trim();
-			if (contentType.indexOf("/") <= 0) {
+			if (!contentType.includes("/")) {
 				contentType = null;
 			}
 			const charsetValue = matchContentType[1] && matchContentType[1].trim();