Features
Rut.ts provides a comprehensive set of functions for working with Chilean RUTs.
Core Functions
Validation
validate()- Check if a RUT is valid with optional strict mode
Formatting
format()- Convert RUTs to standardized formatclean()- Remove formatting characters
Analysis
decompose()- Split RUT into body and verifiergetBody()- Extract just the bodygetVerifier()- Extract just the verifier digitcalculateVerifier()- Calculate verifier for a given body
Generation & Detection
generate()- Generate random valid RUTsisRutLike()- Quick format check without full validation
Common Features
All functions support:
- ✅ TypeScript types - Full type safety
- ✅ Safe mode -
{ throwOnError: false }returnsnullinstead of throwing - ✅ Multiple formats - Works with dots, hyphens, or plain numbers
- ✅ Leading zeros - Automatically handles and removes them
Function Categories
Last updated on