diff --git a/packages/endpoint-micropub/lib/update.js b/packages/endpoint-micropub/lib/update.js index 5bdcf31d8..102db7c95 100644 --- a/packages/endpoint-micropub/lib/update.js +++ b/packages/endpoint-micropub/lib/update.js @@ -97,7 +97,7 @@ export const deleteEntries = (object, deletions) => { for (const value of valuesToDelete) { const index = values.indexOf(value); - if (index > -1) { + if (index !== -1) { values.splice(index, 1); } diff --git a/packages/frontend/components/character-count/index.js b/packages/frontend/components/character-count/index.js index 9ce869f2a..3dc3a662d 100644 --- a/packages/frontend/components/character-count/index.js +++ b/packages/frontend/components/character-count/index.js @@ -77,7 +77,7 @@ export const CharacterCountComponent = class extends HTMLElement { * @access private */ #handleFocus() { - this.valueChecker = window.setInterval(() => { + this.valueChecker = globalThis.setInterval(() => { if ( !this.lastInputTimestamp || Date.now() - 500 >= this.lastInputTimestamp @@ -93,7 +93,7 @@ export const CharacterCountComponent = class extends HTMLElement { */ #handleBlur() { if (this.valueChecker) { - window.clearInterval(this.valueChecker); + globalThis.clearInterval(this.valueChecker); } } diff --git a/packages/frontend/components/share-preview/index.js b/packages/frontend/components/share-preview/index.js index 1ac35100e..04febbd32 100644 --- a/packages/frontend/components/share-preview/index.js +++ b/packages/frontend/components/share-preview/index.js @@ -16,8 +16,8 @@ export const SharePreviewComponent = class extends HTMLElement { if (this.$form) { const { scrollWidth, scrollHeight } = this.$form; - const chromeWidth = window.outerWidth - window.innerWidth; - const chromeHeight = window.outerHeight - window.innerHeight; + const chromeWidth = globalThis.outerWidth - window.innerWidth; + const chromeHeight = globalThis.outerHeight - window.innerHeight; const width = scrollWidth + chromeWidth; const height = scrollHeight + chromeHeight; diff --git a/packages/frontend/lib/serviceworker.js b/packages/frontend/lib/serviceworker.js index b2b3beef7..5c5004d49 100644 --- a/packages/frontend/lib/serviceworker.js +++ b/packages/frontend/lib/serviceworker.js @@ -91,7 +91,7 @@ self.addEventListener("install", async (event) => { (async () => { await updateAssetCache(); await cacheClients(); - self.skipWaiting(); + globalThis.skipWaiting(); })(), ); });