Skip to content

Commit ebb1108

Browse files
committed
fix: correct org name regexp
1 parent 433494c commit ebb1108

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

server/api/registry/org/[org]/packages.get.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { CACHE_MAX_AGE_ONE_HOUR, NPM_REGISTRY } from '#shared/utils/constants'
22
import { FetchError } from 'ofetch'
33

44
// Validation pattern for npm org names (alphanumeric with hyphens)
5-
const NPM_ORG_NAME_RE = /^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i
5+
const NPM_ORG_NAME_RE = /^[\w~-][\w.~-]*$/i
66

77
function validateOrgName(name: string): void {
88
if (!name || name.length > 50 || !NPM_ORG_NAME_RE.test(name)) {

0 commit comments

Comments
 (0)