import type { TransformedFunction } from './trpc'; export const fnMap = new Map>(); /** * Clear mapped transformed functions by socketId. * @param socketId The id of socket. */ export const clearMappedFunctions = (socketId: number) => { if (socketId) { fnMap.get(socketId)?.clear(); fnMap.delete(socketId); } }; /** * Clear all the mapped transformed functions. */ export const clearAllMappedFunctions = () => { for (const map of fnMap.values()) { map.clear(); } fnMap.clear(); };