This commit is contained in:
Kalle (Sendou) 2022-01-11 23:14:19 +02:00
parent 9f99a45b92
commit 403b61486f
5 changed files with 88 additions and 86 deletions

File diff suppressed because one or more lines are too long

View File

@ -13,8 +13,8 @@ export const useUser = () => {
export const useBaseURL = () => {
const [root] = useMatches();
const parsed = z.object({ baseURL: z.string() }).nullish().parse(root.data);
return parsed?.baseURL;
const parsed = z.object({ baseURL: z.string() }).parse(root.data);
return parsed.baseURL;
};
// TODO: fix causes memory leak

163
package-lock.json generated
View File

@ -45,8 +45,8 @@
"@types/react": "^17.0.38",
"@types/react-dom": "^17.0.11",
"@types/uuid": "^8.3.4",
"@typescript-eslint/eslint-plugin": "^5.9.0",
"@typescript-eslint/parser": "^5.9.0",
"@typescript-eslint/eslint-plugin": "^5.9.1",
"@typescript-eslint/parser": "^5.9.1",
"concurrently": "^7.0.0",
"cypress": "^9.2.0",
"eslint": "^8.6.0",
@ -64,7 +64,8 @@
"uvu": "^0.5.3"
},
"engines": {
"node": ">=14"
"node": ">=16",
"npm": ">=8"
}
},
"node_modules/@babel/code-frame": {
@ -1026,14 +1027,14 @@
}
},
"node_modules/@typescript-eslint/eslint-plugin": {
"version": "5.9.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.9.0.tgz",
"integrity": "sha512-qT4lr2jysDQBQOPsCCvpPUZHjbABoTJW8V9ZzIYKHMfppJtpdtzszDYsldwhFxlhvrp7aCHeXD1Lb9M1zhwWwQ==",
"version": "5.9.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.9.1.tgz",
"integrity": "sha512-Xv9tkFlyD4MQGpJgTo6wqDqGvHIRmRgah/2Sjz1PUnJTawjHWIwBivUE9x0QtU2WVii9baYgavo/bHjrZJkqTw==",
"dev": true,
"dependencies": {
"@typescript-eslint/experimental-utils": "5.9.0",
"@typescript-eslint/scope-manager": "5.9.0",
"@typescript-eslint/type-utils": "5.9.0",
"@typescript-eslint/experimental-utils": "5.9.1",
"@typescript-eslint/scope-manager": "5.9.1",
"@typescript-eslint/type-utils": "5.9.1",
"debug": "^4.3.2",
"functional-red-black-tree": "^1.0.1",
"ignore": "^5.1.8",
@ -1082,15 +1083,15 @@
"dev": true
},
"node_modules/@typescript-eslint/experimental-utils": {
"version": "5.9.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-5.9.0.tgz",
"integrity": "sha512-ZnLVjBrf26dn7ElyaSKa6uDhqwvAi4jBBmHK1VxuFGPRAxhdi18ubQYSGA7SRiFiES3q9JiBOBHEBStOFkwD2g==",
"version": "5.9.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-5.9.1.tgz",
"integrity": "sha512-cb1Njyss0mLL9kLXgS/eEY53SZQ9sT519wpX3i+U457l2UXRDuo87hgKfgRazmu9/tQb0x2sr3Y0yrU+Zz0y+w==",
"dev": true,
"dependencies": {
"@types/json-schema": "^7.0.9",
"@typescript-eslint/scope-manager": "5.9.0",
"@typescript-eslint/types": "5.9.0",
"@typescript-eslint/typescript-estree": "5.9.0",
"@typescript-eslint/scope-manager": "5.9.1",
"@typescript-eslint/types": "5.9.1",
"@typescript-eslint/typescript-estree": "5.9.1",
"eslint-scope": "^5.1.1",
"eslint-utils": "^3.0.0"
},
@ -1106,14 +1107,14 @@
}
},
"node_modules/@typescript-eslint/parser": {
"version": "5.9.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.9.0.tgz",
"integrity": "sha512-/6pOPz8yAxEt4PLzgbFRDpZmHnXCeZgPDrh/1DaVKOjvn/UPMlWhbx/gA96xRi2JxY1kBl2AmwVbyROUqys5xQ==",
"version": "5.9.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.9.1.tgz",
"integrity": "sha512-PLYO0AmwD6s6n0ZQB5kqPgfvh73p0+VqopQQLuNfi7Lm0EpfKyDalchpVwkE+81k5HeiRrTV/9w1aNHzjD7C4g==",
"dev": true,
"dependencies": {
"@typescript-eslint/scope-manager": "5.9.0",
"@typescript-eslint/types": "5.9.0",
"@typescript-eslint/typescript-estree": "5.9.0",
"@typescript-eslint/scope-manager": "5.9.1",
"@typescript-eslint/types": "5.9.1",
"@typescript-eslint/typescript-estree": "5.9.1",
"debug": "^4.3.2"
},
"engines": {
@ -1156,13 +1157,13 @@
"dev": true
},
"node_modules/@typescript-eslint/scope-manager": {
"version": "5.9.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.9.0.tgz",
"integrity": "sha512-DKtdIL49Qxk2a8icF6whRk7uThuVz4A6TCXfjdJSwOsf+9ree7vgQWcx0KOyCdk0i9ETX666p4aMhrRhxhUkyg==",
"version": "5.9.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.9.1.tgz",
"integrity": "sha512-8BwvWkho3B/UOtzRyW07ffJXPaLSUKFBjpq8aqsRvu6HdEuzCY57+ffT7QoV4QXJXWSU1+7g3wE4AlgImmQ9pQ==",
"dev": true,
"dependencies": {
"@typescript-eslint/types": "5.9.0",
"@typescript-eslint/visitor-keys": "5.9.0"
"@typescript-eslint/types": "5.9.1",
"@typescript-eslint/visitor-keys": "5.9.1"
},
"engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
@ -1173,12 +1174,12 @@
}
},
"node_modules/@typescript-eslint/type-utils": {
"version": "5.9.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.9.0.tgz",
"integrity": "sha512-uVCb9dJXpBrK1071ri5aEW7ZHdDHAiqEjYznF3HSSvAJXyrkxGOw2Ejibz/q6BXdT8lea8CMI0CzKNFTNI6TEQ==",
"version": "5.9.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.9.1.tgz",
"integrity": "sha512-tRSpdBnPRssjlUh35rE9ug5HrUvaB9ntREy7gPXXKwmIx61TNN7+l5YKgi1hMKxo5NvqZCfYhA5FvyuJG6X6vg==",
"dev": true,
"dependencies": {
"@typescript-eslint/experimental-utils": "5.9.0",
"@typescript-eslint/experimental-utils": "5.9.1",
"debug": "^4.3.2",
"tsutils": "^3.21.0"
},
@ -1222,9 +1223,9 @@
"dev": true
},
"node_modules/@typescript-eslint/types": {
"version": "5.9.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.9.0.tgz",
"integrity": "sha512-mWp6/b56Umo1rwyGCk8fPIzb9Migo8YOniBGPAQDNC6C52SeyNGN4gsVwQTAR+RS2L5xyajON4hOLwAGwPtUwg==",
"version": "5.9.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.9.1.tgz",
"integrity": "sha512-SsWegWudWpkZCwwYcKoDwuAjoZXnM1y2EbEerTHho19Hmm+bQ56QG4L4jrtCu0bI5STaRTvRTZmjprWlTw/5NQ==",
"dev": true,
"engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
@ -1235,13 +1236,13 @@
}
},
"node_modules/@typescript-eslint/typescript-estree": {
"version": "5.9.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.9.0.tgz",
"integrity": "sha512-kxo3xL2mB7XmiVZcECbaDwYCt3qFXz99tBSuVJR4L/sR7CJ+UNAPrYILILktGj1ppfZ/jNt/cWYbziJUlHl1Pw==",
"version": "5.9.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.9.1.tgz",
"integrity": "sha512-gL1sP6A/KG0HwrahVXI9fZyeVTxEYV//6PmcOn1tD0rw8VhUWYeZeuWHwwhnewnvEMcHjhnJLOBhA9rK4vmb8A==",
"dev": true,
"dependencies": {
"@typescript-eslint/types": "5.9.0",
"@typescript-eslint/visitor-keys": "5.9.0",
"@typescript-eslint/types": "5.9.1",
"@typescript-eslint/visitor-keys": "5.9.1",
"debug": "^4.3.2",
"globby": "^11.0.4",
"is-glob": "^4.0.3",
@ -1285,12 +1286,12 @@
"dev": true
},
"node_modules/@typescript-eslint/visitor-keys": {
"version": "5.9.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.9.0.tgz",
"integrity": "sha512-6zq0mb7LV0ThExKlecvpfepiB+XEtFv/bzx7/jKSgyXTFD7qjmSu1FoiS0x3OZaiS+UIXpH2vd9O89f02RCtgw==",
"version": "5.9.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.9.1.tgz",
"integrity": "sha512-Xh37pNz9e9ryW4TVdwiFzmr4hloty8cFj8GTWMXh3Z8swGwyQWeCcNgF0hm6t09iZd6eiZmIf4zHedQVP6TVtg==",
"dev": true,
"dependencies": {
"@typescript-eslint/types": "5.9.0",
"@typescript-eslint/types": "5.9.1",
"eslint-visitor-keys": "^3.0.0"
},
"engines": {
@ -10962,14 +10963,14 @@
}
},
"@typescript-eslint/eslint-plugin": {
"version": "5.9.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.9.0.tgz",
"integrity": "sha512-qT4lr2jysDQBQOPsCCvpPUZHjbABoTJW8V9ZzIYKHMfppJtpdtzszDYsldwhFxlhvrp7aCHeXD1Lb9M1zhwWwQ==",
"version": "5.9.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.9.1.tgz",
"integrity": "sha512-Xv9tkFlyD4MQGpJgTo6wqDqGvHIRmRgah/2Sjz1PUnJTawjHWIwBivUE9x0QtU2WVii9baYgavo/bHjrZJkqTw==",
"dev": true,
"requires": {
"@typescript-eslint/experimental-utils": "5.9.0",
"@typescript-eslint/scope-manager": "5.9.0",
"@typescript-eslint/type-utils": "5.9.0",
"@typescript-eslint/experimental-utils": "5.9.1",
"@typescript-eslint/scope-manager": "5.9.1",
"@typescript-eslint/type-utils": "5.9.1",
"debug": "^4.3.2",
"functional-red-black-tree": "^1.0.1",
"ignore": "^5.1.8",
@ -10996,28 +10997,28 @@
}
},
"@typescript-eslint/experimental-utils": {
"version": "5.9.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-5.9.0.tgz",
"integrity": "sha512-ZnLVjBrf26dn7ElyaSKa6uDhqwvAi4jBBmHK1VxuFGPRAxhdi18ubQYSGA7SRiFiES3q9JiBOBHEBStOFkwD2g==",
"version": "5.9.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-5.9.1.tgz",
"integrity": "sha512-cb1Njyss0mLL9kLXgS/eEY53SZQ9sT519wpX3i+U457l2UXRDuo87hgKfgRazmu9/tQb0x2sr3Y0yrU+Zz0y+w==",
"dev": true,
"requires": {
"@types/json-schema": "^7.0.9",
"@typescript-eslint/scope-manager": "5.9.0",
"@typescript-eslint/types": "5.9.0",
"@typescript-eslint/typescript-estree": "5.9.0",
"@typescript-eslint/scope-manager": "5.9.1",
"@typescript-eslint/types": "5.9.1",
"@typescript-eslint/typescript-estree": "5.9.1",
"eslint-scope": "^5.1.1",
"eslint-utils": "^3.0.0"
}
},
"@typescript-eslint/parser": {
"version": "5.9.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.9.0.tgz",
"integrity": "sha512-/6pOPz8yAxEt4PLzgbFRDpZmHnXCeZgPDrh/1DaVKOjvn/UPMlWhbx/gA96xRi2JxY1kBl2AmwVbyROUqys5xQ==",
"version": "5.9.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.9.1.tgz",
"integrity": "sha512-PLYO0AmwD6s6n0ZQB5kqPgfvh73p0+VqopQQLuNfi7Lm0EpfKyDalchpVwkE+81k5HeiRrTV/9w1aNHzjD7C4g==",
"dev": true,
"requires": {
"@typescript-eslint/scope-manager": "5.9.0",
"@typescript-eslint/types": "5.9.0",
"@typescript-eslint/typescript-estree": "5.9.0",
"@typescript-eslint/scope-manager": "5.9.1",
"@typescript-eslint/types": "5.9.1",
"@typescript-eslint/typescript-estree": "5.9.1",
"debug": "^4.3.2"
},
"dependencies": {
@ -11039,22 +11040,22 @@
}
},
"@typescript-eslint/scope-manager": {
"version": "5.9.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.9.0.tgz",
"integrity": "sha512-DKtdIL49Qxk2a8icF6whRk7uThuVz4A6TCXfjdJSwOsf+9ree7vgQWcx0KOyCdk0i9ETX666p4aMhrRhxhUkyg==",
"version": "5.9.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.9.1.tgz",
"integrity": "sha512-8BwvWkho3B/UOtzRyW07ffJXPaLSUKFBjpq8aqsRvu6HdEuzCY57+ffT7QoV4QXJXWSU1+7g3wE4AlgImmQ9pQ==",
"dev": true,
"requires": {
"@typescript-eslint/types": "5.9.0",
"@typescript-eslint/visitor-keys": "5.9.0"
"@typescript-eslint/types": "5.9.1",
"@typescript-eslint/visitor-keys": "5.9.1"
}
},
"@typescript-eslint/type-utils": {
"version": "5.9.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.9.0.tgz",
"integrity": "sha512-uVCb9dJXpBrK1071ri5aEW7ZHdDHAiqEjYznF3HSSvAJXyrkxGOw2Ejibz/q6BXdT8lea8CMI0CzKNFTNI6TEQ==",
"version": "5.9.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.9.1.tgz",
"integrity": "sha512-tRSpdBnPRssjlUh35rE9ug5HrUvaB9ntREy7gPXXKwmIx61TNN7+l5YKgi1hMKxo5NvqZCfYhA5FvyuJG6X6vg==",
"dev": true,
"requires": {
"@typescript-eslint/experimental-utils": "5.9.0",
"@typescript-eslint/experimental-utils": "5.9.1",
"debug": "^4.3.2",
"tsutils": "^3.21.0"
},
@ -11077,19 +11078,19 @@
}
},
"@typescript-eslint/types": {
"version": "5.9.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.9.0.tgz",
"integrity": "sha512-mWp6/b56Umo1rwyGCk8fPIzb9Migo8YOniBGPAQDNC6C52SeyNGN4gsVwQTAR+RS2L5xyajON4hOLwAGwPtUwg==",
"version": "5.9.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.9.1.tgz",
"integrity": "sha512-SsWegWudWpkZCwwYcKoDwuAjoZXnM1y2EbEerTHho19Hmm+bQ56QG4L4jrtCu0bI5STaRTvRTZmjprWlTw/5NQ==",
"dev": true
},
"@typescript-eslint/typescript-estree": {
"version": "5.9.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.9.0.tgz",
"integrity": "sha512-kxo3xL2mB7XmiVZcECbaDwYCt3qFXz99tBSuVJR4L/sR7CJ+UNAPrYILILktGj1ppfZ/jNt/cWYbziJUlHl1Pw==",
"version": "5.9.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.9.1.tgz",
"integrity": "sha512-gL1sP6A/KG0HwrahVXI9fZyeVTxEYV//6PmcOn1tD0rw8VhUWYeZeuWHwwhnewnvEMcHjhnJLOBhA9rK4vmb8A==",
"dev": true,
"requires": {
"@typescript-eslint/types": "5.9.0",
"@typescript-eslint/visitor-keys": "5.9.0",
"@typescript-eslint/types": "5.9.1",
"@typescript-eslint/visitor-keys": "5.9.1",
"debug": "^4.3.2",
"globby": "^11.0.4",
"is-glob": "^4.0.3",
@ -11115,12 +11116,12 @@
}
},
"@typescript-eslint/visitor-keys": {
"version": "5.9.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.9.0.tgz",
"integrity": "sha512-6zq0mb7LV0ThExKlecvpfepiB+XEtFv/bzx7/jKSgyXTFD7qjmSu1FoiS0x3OZaiS+UIXpH2vd9O89f02RCtgw==",
"version": "5.9.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.9.1.tgz",
"integrity": "sha512-Xh37pNz9e9ryW4TVdwiFzmr4hloty8cFj8GTWMXh3Z8swGwyQWeCcNgF0hm6t09iZd6eiZmIf4zHedQVP6TVtg==",
"dev": true,
"requires": {
"@typescript-eslint/types": "5.9.0",
"@typescript-eslint/types": "5.9.1",
"eslint-visitor-keys": "^3.0.0"
}
},

View File

@ -60,8 +60,8 @@
"@types/react": "^17.0.38",
"@types/react-dom": "^17.0.11",
"@types/uuid": "^8.3.4",
"@typescript-eslint/eslint-plugin": "^5.9.0",
"@typescript-eslint/parser": "^5.9.0",
"@typescript-eslint/eslint-plugin": "^5.9.1",
"@typescript-eslint/parser": "^5.9.1",
"concurrently": "^7.0.0",
"cypress": "^9.2.0",
"eslint": "^8.6.0",

View File

@ -16,7 +16,7 @@ export function setUpEvents(app: Express): void {
res.flushHeaders();
let counter = 0;
let interValID = setInterval(() => {
const interValID = setInterval(() => {
counter++;
console.log("write", counter);
res.write(`data: ${JSON.stringify({ num: counter })}\n\n`); // res.write() instead of res.send()