работаем бля работаем

This commit is contained in:
2026-05-09 03:21:44 +06:00
parent f845777bac
commit 0b148c6a7d
169 changed files with 15816 additions and 1005 deletions

View File

@@ -1,12 +0,0 @@
import type { ChadClient, SomeSocket } from '../types/webrtc.ts'
export function socketToClient(socket: SomeSocket): ChadClient {
return {
socketId: socket.id,
userId: socket.data.userId,
username: socket.data.username,
displayName: socket.data.displayName,
inputMuted: socket.data.inputMuted,
outputMuted: socket.data.outputMuted,
}
}

View File

@@ -0,0 +1,12 @@
import type { Static, TSchema, TSchemaOptions, TUnsafe } from 'typebox'
import { Unsafe } from 'typebox'
export function TypeboxRef<T extends TSchema>(t: T, options: TSchemaOptions = {}): TUnsafe<Static<T>> {
const id = (t as unknown as Record<string, string | undefined>).$id
if (!id) {
throw new Error('missing ID on schema')
}
return Unsafe<Static<T>>({ ...t, $ref: id, $id: undefined, ...options })
}