(userId: string)
| 287 | * @param userId 用户ID |
| 288 | */ |
| 289 | export async function fetchUserInfo(userId: string): Promise<UserBaseInfo> { |
| 290 | if ( |
| 291 | builtinUserInfo[userId] && |
| 292 | typeof builtinUserInfo[userId] === 'function' |
| 293 | ) { |
| 294 | return builtinUserInfo[userId](); |
| 295 | } |
| 296 | |
| 297 | if (!isObjectId(userId)) { |
| 298 | throw new Error(`Invalid userId: ${userId}`); |
| 299 | } |
| 300 | |
| 301 | const userInfo = await _fetchUserInfo(userId); |
| 302 | |
| 303 | return userInfo; |
| 304 | } |
| 305 | |
| 306 | const _fetchUserOnlineStatus = createAutoMergedRequest<string[], boolean[]>( |
| 307 | createAutoSplitRequest( |
no test coverage detected