rutility
Version:
A JavaScript library for validating and formatting Chilean RUTs (Rol Único Tributario). It provides functions to add/remove dots and dashes, validate formats, and calculate check digits
18 lines • 796 B
TypeScript
/**
* Basic validations of the format of a Chilean RUT (Rol Único Tributario).
* Checks if the RUT is a string, does not start with zero, and follows the correct numeric format.
* Throws an error if the RUT is invalid.
*
* @param {string} rut - The RUT to validate.
* @throws {Error} If the RUT is not a string.
* @throws {Error} If the RUT starts with zero.
* @throws {Error} If the RUT does not match the expected format.
*/
export declare const formatValidations: (rut: string) => void;
/**
* Validates the format of a Chilean RUT (Rol Único Tributario).
* @param {string} rut - The RUT to validate.
* @returns {boolean} True if the format is valid, false otherwise.
*/
export declare const isValidFormatWithOutDash: (rut: string) => boolean;
//# sourceMappingURL=utils.d.ts.map