MCPcopy
hub / github.com/npmx-dev/npmx.dev / validateUsername

Function validateUsername

cli/src/npm-client.ts:43–48  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

41 * @internal
42 */
43export function validateUsername(name: string): void {
44 const result = v.safeParse(UsernameSchema, name)
45 if (!result.success) {
46 throw new Error(`Invalid username: ${name}`)
47 }
48}
49
50/**
51 * Validates an npm org name (without the @ prefix)

Callers 8

npm-client.spec.tsFile · 0.90
orgAddUserFunction · 0.85
orgRemoveUserFunction · 0.85
teamAddUserFunction · 0.85
teamRemoveUserFunction · 0.85
ownerAddFunction · 0.85
ownerRemoveFunction · 0.85
listUserPackagesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected