bloodtype-validator
v0.0.2
Published
Tiny module to check if given bloodtype is valid
Downloads
6
Readme
BLOODTYPE-VALIDATOR
Confirms Value is a Valid Bloodtype
Installation
npm install bloodtype-validator
Simple Validation
require('bloodtype-validator')( 'a' ) // returns true
require('bloodtype-validator')( 'a', function( error, is_valid ){
// is_valid === true
});
Strict Validation
In addition to being a valid bloodtype, genotype indicator (+/-) must be included.
require('bloodtype-validator')( 'a', 'strict' ) // returns false
require('bloodtype-validator')( 'a+', 'strict' ) // returns true
require('bloodtype-validator')( 'a', 'strict', function( error, is_valid ){
// is_valid === false
});
require('bloodtype-validator')( 'a+', 'strict', function( error, is_valid ){
// is_valid === true
});