탈(Taal) means a mask in Korean. Taal.js is a basic and simple input masking helper. This does not have any framework dependency.
- You can import by just simply add Taal.js file into your project.
- Taal( userInput, maskPattern ) will return an object with three keys.
Example
/*
* You have to use 0s in your mask pattern in order to replace 0 into your input.
* User input must be in string
*/
Taal( '6503213323', '(000)000-0000') // this will return { hasError: false, errorMessage: '', result: '(650)321-3323'}
Taal( '65032133233', '(000)000-0000') // this will return { hasError: true, errorMessage: 'your input length is not compatible with given mask', result: ''}
Taal( '12211990', '00/00/0000') // this will return { hasError: false, errorMessage: '', result: '12/21/1990'}
- Entry point change for require or import statement
- Export default function added (Bug fix)
- Karma issue fixed.
- Minor edge case has handled
- Project initiated and test spec has created.
- Basic functionality has been created
- Has issue with Karma testing