Small TypeScript validation helpers extracted from
hn_email_template outerTemplate component validation.
npm install @llazyemail/validatorimport { validateInput } from '@llazyemail/validator';
validateInput(
{ title: 'Newsletter', headStyles: '<style></style>' },
[
{ field: 'title', errorMessage: 'no title was passed' },
{ field: 'headStyles', errorMessage: 'no headStyles was passed' },
],
);Built-in rules: required, nonEmptyString, string.
A check defaults to ['required', 'nonEmptyString'] when rules is omitted.
npm install
npm test
npm run buildtsup emits ESM + CJS + .d.ts into dist/.