1.0.4 • Published 3 years ago

cb-rut-helpers v1.0.4

Weekly downloads
21
License
-
Repository
-
Last release
3 years ago

Rut Helpers

Helpers to validate and format strings to RUT (Chilean DNI).

Installation

npm install cb-rut-helpers --save

Use

// You can import everything
import * as rutHelpers from 'cb-rut-helpers';

// Or import only what you need.
import { rutValidate, rutFormat } from 'cb-rut-helpers';

// Or with node
var rutHelpers = require('cb-rut-helpers');

Validating RUTs

rutHelpers.rutValidate('THIS IS A RUT');
// false

rutHelpers.rutValidate('18.016.884-2');
// true

rutHelpers.rutValidate('180168842');
// true

Formatting strings as RUTs

rutHelpers.rutFormat('180168842');
// 7.618.285-K

Cleaning RUTs

rutHelpers.rutClean('18.016.884-2');
// 7618285K
1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago