import { z } from 'zod'; import { replaceSchema } from '../../shared/definition.js'; export function regexOfOption(option: z.infer | undefined) { if (option === undefined) { return new RegExp(''); } return new RegExp( typeof option.regex === 'string' ? option.regex : option.regex.pattern, typeof option.regex === 'string' ? undefined : option.regex.flags, ); }