mirror of
https://code.lenaisten.de/Lenaisten/advent22.git
synced 2026-01-09 14:43:00 +00:00
🐛 use ?? operator where suited instead of ||
This commit is contained in:
parent
6a7491b15b
commit
1a865da656
2 changed files with 2 additions and 2 deletions
|
|
@ -67,7 +67,7 @@ export class Rectangle {
|
|||
}
|
||||
|
||||
public update(corner_1?: Vector2D, corner_2?: Vector2D): Rectangle {
|
||||
return new Rectangle(corner_1 || this.corner_1, corner_2 || this.corner_2);
|
||||
return new Rectangle(corner_1 ?? this.corner_1, corner_2 ?? this.corner_2);
|
||||
}
|
||||
|
||||
public move(vector: Vector2D): Rectangle {
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ export const advent22Store = defineStore({
|
|||
const favicon = await API.request<ImageData>("user/favicon");
|
||||
|
||||
const link: HTMLLinkElement =
|
||||
document.querySelector("link[rel*='icon']") ||
|
||||
document.querySelector("link[rel*='icon']") ??
|
||||
document.createElement("link");
|
||||
link.rel = "shortcut icon";
|
||||
link.type = "image/x-icon";
|
||||
|
|
|
|||
Loading…
Reference in a new issue