Updated dependencies and linter

This commit is contained in:
n1474335 2019-07-05 12:22:52 +01:00
parent 4f70a79638
commit 5eb3979504
23 changed files with 383 additions and 263 deletions

View file

@ -216,7 +216,7 @@ class App {
for (let j = 0; j < catConf.ops.length; j++) {
const opName = catConf.ops[j];
if (!this.operations.hasOwnProperty(opName)) {
if (!(opName in this.operations)) {
log.warn(`${opName} could not be found.`);
continue;
}
@ -330,7 +330,7 @@ class App {
validFavourites(favourites) {
const validFavs = [];
for (let i = 0; i < favourites.length; i++) {
if (this.operations.hasOwnProperty(favourites[i])) {
if (favourites[i] in this.operations) {
validFavs.push(favourites[i]);
} else {
this.alert(`The operation "${Utils.escapeHtml(favourites[i])}" is no longer available. ` +

View file

@ -267,16 +267,16 @@ class InputWaiter {
*/
handleLoaderMessage(e) {
const r = e.data;
if (r.hasOwnProperty("progress")) {
if (Object.prototype.hasOwnProperty.call(r, "progress")) {
const fileLoaded = document.getElementById("input-file-loaded");
fileLoaded.textContent = r.progress + "%";
}
if (r.hasOwnProperty("error")) {
if (Object.prototype.hasOwnProperty.call(r, "error")) {
this.app.alert(r.error, 10000);
}
if (r.hasOwnProperty("fileBuffer")) {
if (Object.prototype.hasOwnProperty.call(r, "fileBuffer")) {
log.debug("Input file loaded");
this.fileBuffer = r.fileBuffer;
this.displayFilePreview();

View file

@ -12,7 +12,7 @@
*/
self.addEventListener("message", function(e) {
const r = e.data;
if (r.hasOwnProperty("file")) {
if (Object.prototype.hasOwnProperty.call(r, "file")) {
self.loadFile(r.file);
}
});

View file

@ -275,7 +275,7 @@ class Manager {
callback: callback.bind(scope || this)
};
if (this.dynamicHandlers.hasOwnProperty(eventType)) {
if (Object.prototype.hasOwnProperty.call(this.dynamicHandlers, eventType)) {
// Listener already exists, add new handler to the appropriate list
this.dynamicHandlers[eventType].push(eventConfig);
} else {

View file

@ -81,7 +81,7 @@ class SeasonalWaiter {
</div>`;
optionsBody.appendChild(optionItem);
if (!this.app.options.hasOwnProperty("clippy")) {
if (!("clippy" in this.app.options)) {
this.app.options.clippy = true;
}