1
0
mirror of https://github.com/ONLYOFFICE/onlyoffice-owncloud.git synced 2025-04-18 13:24:05 +03:00

refactor: use type safe equality operators

This commit is contained in:
rivexe 2024-07-18 10:12:00 +03:00
parent b3f60f8d0d
commit a82e88aada
6 changed files with 14 additions and 10 deletions

View File

@ -5,6 +5,7 @@
"multiline-ternary": ["error", "always-multiline"],
"no-var": "error",
"prefer-const": "error",
"object-shorthand": ["error", "always"]
"object-shorthand": ["error", "always"],
"eqeqeq": ["error", "smart"]
}
}

View File

@ -64,7 +64,10 @@
}
const docsVersion = DocsAPI.DocEditor.version().split(".");
if (docsVersion[0] < 6 || (docsVersion[0] == 6 && docsVersion[1] == 0)) {
if (
docsVersion[0] < 6 ||
(parseInt(docsVersion[0]) === 6 && parseInt(docsVersion[1]) === 0)
) {
OCA.Onlyoffice.showMessage(
t(OCA.Onlyoffice.AppName, "Not supported version"),
"error",
@ -643,7 +646,7 @@
let url = location.href;
if (event && event.data) {
const indexAnchor = url.indexOf("#");
if (indexAnchor != -1) {
if (parseInt(indexAnchor) !== -1) {
url = url.substring(0, indexAnchor);
}
@ -659,7 +662,7 @@
if (anchorRegex.test(url)) {
url = url.replace(anchorRegex, data);
} else {
url += url.indexOf("?") == -1 ? "?" : "&";
url += url.indexOf("?") === -1 ? "?" : "&";
url += data;
}
}

View File

@ -201,7 +201,7 @@
window.addEventListener("popstate", function (event) {
if (
$("#onlyofficeFrame").length &&
location.href.indexOf(OCA.Onlyoffice.AppName) == -1
location.href.indexOf(OCA.Onlyoffice.AppName) === -1
) {
OCA.Onlyoffice.onRequestClose();
}

View File

@ -277,7 +277,7 @@
return;
}
if (response.parentId == fileList.dirInfo.id) {
if (response.parentId === fileList.dirInfo.id) {
fileList.add(response, { animate: true });
}

View File

@ -44,7 +44,7 @@
$("#onlyofficeGroups").prop(
"checked",
$("#onlyofficeLimitGroups").val() != ""
$("#onlyofficeLimitGroups").val() !== ""
);
const groupListToggle = function () {
@ -268,7 +268,7 @@
});
$("#onlyofficeSecret-show").click(function () {
if ($("#onlyofficeSecret").attr("type") == "password") {
if ($("#onlyofficeSecret").attr("type") === "password") {
$("#onlyofficeSecret").attr("type", "text");
} else {
$("#onlyofficeSecret").attr("type", "password");

View File

@ -2626,7 +2626,7 @@ define(["vue"], function (vue) {
const isArray =
Array.isArray ||
function (arr) {
return toString.call(arr) == "[object Array]";
return toString.call(arr) === "[object Array]";
};
const INSPECT_MAX_BYTES = 50;
@ -7698,7 +7698,7 @@ define(["vue"], function (vue) {
},
create() {
return new Promise((resolve, reject) => {
if (this.mode != "create") {
if (this.mode !== "create") {
resolve();
return;
}