File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -33,8 +33,6 @@ import {
3333 WebSocketsAccessSettings ,
3434} from "./settings.js" ;
3535
36- type UnknownObject = Record < string , unknown > ;
37-
3836async function main ( ) : Promise < void > {
3937 let settingsFileData : Buffer | undefined = undefined ;
4038
@@ -56,13 +54,13 @@ async function main(): Promise<void> {
5654 }
5755 }
5856
59- let jsonSettings : UnknownObject | undefined = undefined ;
57+ let jsonSettings : Record < string , unknown > | undefined = undefined ;
6058
6159 try {
6260 jsonSettings =
6361 settingsFileData === undefined
6462 ? { }
65- : ( JSON . parse ( settingsFileData . toString ( ) ) as UnknownObject ) ;
63+ : ( JSON . parse ( settingsFileData . toString ( ) ) as Record < string , unknown > ) ;
6664 } catch ( e ) {
6765 console . error ( "failed to parse JSON configuration file:" , e ) ;
6866 return ;
Original file line number Diff line number Diff line change 1515 */
1616
1717/* eslint-disable no-console */
18-
19- type UnknownObject = Record < string , unknown > ;
20-
2118export interface Settings {
2219 servers : ServerItemSettings [ ] ;
23- tracker ?: object ;
20+ tracker ?: Record < string , unknown > ;
2421 websocketsAccess ?: Partial < WebSocketsAccessSettings > ;
2522}
2623
@@ -54,7 +51,7 @@ export interface WebSocketsAccessSettings {
5451}
5552
5653export function validateSettings (
57- jsonSettings : UnknownObject ,
54+ jsonSettings : Record < string , unknown > ,
5855) : Settings | undefined {
5956 if (
6057 jsonSettings . servers !== undefined &&
@@ -105,7 +102,7 @@ export function validateSettings(
105102
106103 return {
107104 servers,
108- tracker : jsonSettings . tracker ,
105+ tracker : jsonSettings . tracker as Record < string , unknown > ,
109106 websocketsAccess : jsonSettings . websocketsAccess ,
110107 } ;
111108}
You can’t perform that action at this time.
0 commit comments