UNPKG

@captive/plop-config

Version:
8 lines (5 loc) 279 B
import type { PlopValidator } from './validator.js'; const camelCaseRegex = /^[a-z][A-Za-z0-9]*$/u; export function requireCamelCase(): PlopValidator<unknown> { return (promptValue) => (camelCaseRegex.test(String(promptValue)) ? true : `${promptValue} must be camelCase`); }