Adjust index WS imports (#2785)

This commit is contained in:
Jaco Greeff
2020-10-26 22:36:03 +01:00
committed by GitHub
parent 26de59ed79
commit fb377fb0d4
12 changed files with 68 additions and 69 deletions
+2 -2
View File
@@ -3,7 +3,7 @@
// from https://stackoverflow.com/questions/19304157/getting-the-reason-why-websockets-closed-with-close-code-1006
const specificStatusCodeMappings: Record<number, string> = {
const known: Record<number, string> = {
1000: 'Normal Closure',
1001: 'Going Away',
1002: 'Protocol Error',
@@ -37,5 +37,5 @@ export function getWSErrorString (code: number): string {
}
}
return specificStatusCodeMappings[code] || '(Unknown)';
return known[code] || '(Unknown)';
}