diff options
author | CommanderRoot <CommanderRoot@users.noreply.github.com> | 2022-03-25 01:22:10 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-25 01:22:10 +0300 |
commit | 9270a146da2c4e487074c1dc1b3646cf328f3868 (patch) | |
tree | 94f306469d01e8ddff74f2318a3ecd31b9d80245 /index.js | |
parent | 7f47cf943048fe78ea6b3b6d5105c2cfca6cbd7c (diff) |
refactor: replace deprecated String.prototype.substr() (#2282)
.substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated
Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
Diffstat (limited to 'index.js')
-rw-r--r-- | index.js | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -214,7 +214,7 @@ class WebTorrent extends EventEmitter { } port.postMessage(chunk) if (!chunk) cleanup() - if (!this.workerKeepAliveInterval) this.workerKeepAliveInterval = setInterval(() => fetch(`${this.serviceWorker.scriptURL.substr(0, this.serviceWorker.scriptURL.lastIndexOf('/') + 1).slice(window.location.origin.length)}webtorrent/keepalive/`), keepAliveTime) + if (!this.workerKeepAliveInterval) this.workerKeepAliveInterval = setInterval(() => fetch(`${this.serviceWorker.scriptURL.slice(0, this.serviceWorker.scriptURL.lastIndexOf('/') + 1).slice(window.location.origin.length)}webtorrent/keepalive/`), keepAliveTime) } else { cleanup() } |