MCPcopy Create free account
hub / github.com/monkeytypegame/monkeytype / isNameAvailable

Function isNameAvailable

backend/src/dal/user.ts:292–300  ·  view source on GitHub ↗
(
  name: string,
  uid: string,
)

Source from the content-addressed store, hash-verified

290}
291
292export async function isNameAvailable(
293 name: string,
294 uid: string,
295): Promise<boolean> {
296 const user = await findByName(name);
297 // if the user found by name is the same as the user we are checking for, then the name is available
298 // this means that the user can update the casing of their name without it being taken
299 return user === undefined || user.uid === uid;
300}
301
302export async function getUserByName(
303 name: string,

Callers 1

updateNameFunction · 0.85

Calls 1

findByNameFunction · 0.85

Tested by

no test coverage detected