Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions server/api/registry/org/[org]/packages.get.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { CACHE_MAX_AGE_ONE_HOUR, NPM_REGISTRY } from '#shared/utils/constants'
import { FetchError } from 'ofetch'

// Validation pattern for npm org names (alphanumeric with hyphens)
const NPM_ORG_NAME_RE = /^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i
// Validation pattern for npm org names - url-sage symbold and not start with a dot (incl. ~test24214. or -ex~-)
const NPM_ORG_NAME_RE = /^[\w~-][\w.~-]*$/

function validateOrgName(name: string): void {
if (!name || name.length > 50 || !NPM_ORG_NAME_RE.test(name)) {
Expand Down
Loading