Skip to content

The open alternative to Salesforce, designed for AI.

367 B
Raw Blame
import { partnerSlugSchema } from './partner-slug-schema';

// The API schema is strict: a malformed value must be dropped here, not
// forwarded, or it fails the whole brief submission.
export function normalizePartnerSlug(
  raw: string | string[] | undefined,
): string | undefined {
  return partnerSlugSchema.safeParse(Array.isArray(raw) ? raw[0] : raw).data;
}