Skip to content

Commit 2215a36

Browse files
fix: correct org name regexp (#1785)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent 7a4563b commit 2215a36

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

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

4-
// 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
4+
// Validation pattern for npm org names - url-sage symbold and not start with a dot (incl. ~test24214. or -ex~-)
5+
const NPM_ORG_NAME_RE = /^[\w~-][\w.~-]*$/
66

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

0 commit comments

Comments
 (0)