refactor(apis/websocket): clean up imports, format, and fix issues

This commit is contained in:
PalmDevs
2024-01-14 21:46:25 +07:00
parent 3e84821c23
commit a90e59edb8
7 changed files with 25 additions and 29 deletions

View File

@@ -1,6 +1,6 @@
import { existsSync } from 'node:fs'
import { resolve as resolvePath } from 'node:path'
import { pathToFileURL } from 'node:url'
import { existsSync } from 'fs'
import { resolve as resolvePath } from 'path'
import { pathToFileURL } from 'url'
const configPath = resolvePath(process.cwd(), 'config.json')
@@ -17,10 +17,10 @@ const userConfig: Partial<Config> = existsSync(configPath)
type BaseTypeOf<T> = T extends (infer U)[]
? U[]
: T extends (...args: unknown[]) => infer U
? (...args: unknown[]) => U
: T extends object
? { [K in keyof T]: T[K] }
: T
? (...args: unknown[]) => U
: T extends object
? { [K in keyof T]: T[K] }
: T
export type Config = Omit<BaseTypeOf<typeof import('../../config.json')>, '$schema'>

View File

@@ -1,2 +1,2 @@
export { default as getConfig } from './getConfig.js'
export { default as checkEnvironment } from './checkEnvironment.js'
export { default as getConfig } from './getConfig'
export { default as checkEnvironment } from './checkEnvironment'