(name: string)
| 281 | } |
| 282 | |
| 283 | export async function findByName(name: string): Promise<DBUser | undefined> { |
| 284 | const found = await getUsersCollection().findOne( |
| 285 | { name }, |
| 286 | { collation: { locale: "en", strength: 1 } }, |
| 287 | ); |
| 288 | |
| 289 | return found ?? undefined; |
| 290 | } |
| 291 | |
| 292 | export async function isNameAvailable( |
| 293 | name: string, |
no test coverage detected