mirror of
https://github.com/pezkuwichain/pezkuwi-telemetry.git
synced 2026-10-20 18:56:21 +00:00
frontend: Upgrade TypeScript from 2.9.2 to 4.4.2 (#387)
* Upgrade TS from 2.9.2 to 4.4.2 * Avoid mutating a readonly array `list` is a readonly array but `sort` will mutate the array in-place. In newer version of TS, it can catch this unexpected behavior. To avoid mutating a readonly array, we can sort with a new array with either `[...list]` or `list.slice()`. * Fix arguments of `window.location.reload` The `reload` function type definition in `lib.dom.d.ts` takes 0 arguments now. So, we cannot pass a boolean to it. Also, based on the documentation on MDN, Firefox is the only browser who supports passing a `forceForget` boolean to `reload` function. So, I wonder it should be fine to remove the boolean argument and align the behavior to other browsers. Ref: https://developer.mozilla.org/en-US/docs/Web/API/Location/reload
This commit is contained in:
1 parent
87866b2d42
commit
d477cb8045
4 files changed
+9
-7
No files matched your search
@@ -44,7 +44,7 @@
|
|||||||
"tslint": "^6.1.1",
|
"tslint": "^6.1.1",
|
||||||
"tslint-config-prettier": "^1.18.0",
|
"tslint-config-prettier": "^1.18.0",
|
||||||
"tslint-plugin-prettier": "^2.3.0",
|
"tslint-plugin-prettier": "^2.3.0",
|
||||||
"typescript": "^2.9.2"
|
"typescript": "^4.4.2"
|
||||||
},
|
},
|
||||||
"lint-staged": {
|
"lint-staged": {
|
||||||
"src/**/*.{ts,tsx,json,css}": [
|
"src/**/*.{ts,tsx,json,css}": [
|
||||||
|
|||||||
@@ -487,7 +487,7 @@ export class Connection {
|
|||||||
this.clean();
|
this.clean();
|
||||||
|
|
||||||
// Force reload from the server
|
// Force reload from the server
|
||||||
setTimeout(() => window.location.reload(true), 3000);
|
setTimeout(() => window.location.reload(), 3000);
|
||||||
}
|
}
|
||||||
|
|
||||||
private clean() {
|
private clean() {
|
||||||
|
|||||||
@@ -119,7 +119,9 @@ export class NumStats<T extends number> {
|
|||||||
|
|
||||||
let sum = 0;
|
let sum = 0;
|
||||||
|
|
||||||
for (const n of list.sort((a, b) => a - b).slice(extremes, -extremes)) {
|
for (const n of [...list]
|
||||||
|
.sort((a, b) => a - b)
|
||||||
|
.slice(extremes, -extremes)) {
|
||||||
sum += n;
|
sum += n;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+4
-4
@@ -9467,10 +9467,10 @@ typedarray@^0.0.6:
|
|||||||
resolved "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
|
resolved "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
|
||||||
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
|
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
|
||||||
|
|
||||||
typescript@^2.9.2:
|
typescript@^4.4.2:
|
||||||
version "2.9.2"
|
version "4.4.2"
|
||||||
resolved "https://registry.npmjs.org/typescript/-/typescript-2.9.2.tgz#1cbf61d05d6b96269244eb6a3bce4bd914e0f00c"
|
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.4.2.tgz#6d618640d430e3569a1dfb44f7d7e600ced3ee86"
|
||||||
integrity sha512-Gr4p6nFNaoufRIY4NMdpQRNmgxVIGMs4Fcu/ujdYk3nAZqk7supzBE9idmvfZIlH/Cuj//dvi+019qEue9lV0w==
|
integrity sha512-gzP+t5W4hdy4c+68bfcv0t400HVJMMd2+H9B7gae1nQlBzCqvrXX+6GL/b3GAgyTH966pzrZ70/fRjwAtZksSQ==
|
||||||
|
|
||||||
uglify-es@^3.3.4:
|
uglify-es@^3.3.4:
|
||||||
version "3.3.9"
|
version "3.3.9"
|
||||||
|
|||||||
Reference in new issue
Block a user