console fill: labels match straight and curly quotes (Developer’s Advertising, the user’s identity); an App Privacy dialog step with no inputs (the definitions page) is passed with Next

This commit is contained in:
CRTkafa 2026-10-12 07:52:11 +08:00
parent 0035931734
commit 18fde37b9b
4 changed files with 33 additions and 9 deletions

View file

@ -38,7 +38,11 @@ export interface SectionDef {
export interface FormDef { id: FormId; sections: SectionDef[] }
const esc = (s: string): string => s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
// Console labels use typographic quotes ("Developer’s Advertising", "the user’s identity"): every pattern built from a
// label accepts straight and curly quotes alike.
const esc = (s: string): string => s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&').replace(/['\u2018\u2019]/g, "['\u2018\u2019]").replace(/["\u201c\u201d]/g, '["\u201c\u201d]');
/** A label as an exact-match pattern that tolerates straight vs curly quotes (for names that contain a quote). */
export const quoteTolerant = (s: string): RegExp => new RegExp(`^${esc(s)}$`);
const yesNo = (yes: Name[] = ['Yes'], no: Name[] = ['No']): Record<string, Name[]> => ({ true: yes, false: no });
/** IARC topics -> candidate radiogroup names (modeled; see the header). */