UNPKG

@primer/primitives

Version:

Typography, spacing, and color primitives for Primer design system

6 lines (5 loc) 331 B
import { z } from 'zod'; import { schemaErrorMessage } from '../utilities/index.js'; export const referenceValue = z.string().refine(ref => /^{[\w-]+(\.[\w-]+)*(\.[\w-]+|\.@)}$/.test(ref), ref => ({ message: schemaErrorMessage(`Invalid reference: "${ref}"`, 'Reference must be a string in the format "{path.to.token}".'), }));