feat: harden generic preset, add LLM retry, and finish tooling/docs

- PatternDef.validate + Luhn-gated credit-card detection; de-overlap the
  generic phone/date/IP patterns; presets.swiss unchanged (production behavior)
- strip g/y flags from nameHint so .test() is stateless (latent footgun)
- openAICompatibleProvider: bounded retry on transient failures (network /
  timeout / 429 / 5xx), configurable via retries + retryDelayMs
- eslint + prettier + vitest coverage (97%); CI runs lint/format/coverage
- docs: README badges + new-option docs, SECURITY.md, issue/PR templates

26 tests passing; build emits ESM+CJS+types.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Mobiletic
2026-06-24 17:03:20 +01:00
parent f09b917f1a
commit 81b6b03239
21 changed files with 2039 additions and 27 deletions

View File

@@ -9,9 +9,12 @@ new pattern presets, additional LLM providers, docs, and tests.
git clone https://github.com/mobiletic/anonymizer.git
cd anonymizer
npm install
npm test # run the test suite (vitest)
npm run typecheck # tsc --noEmit
npm run build # tsup → dist/ (ESM + CJS + types)
npm test # run the test suite (vitest)
npm run test:coverage # tests + coverage report
npm run typecheck # tsc --noEmit
npm run lint # eslint
npm run format # prettier --write (or `npm run format:check` to verify)
npm run build # tsup → dist/ (ESM + CJS + types)
```
## Guidelines