JSPM

bloodtype-validator

0.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 7
  • Score
    100M100P100Q33228F
  • License MIT

Tiny module to check if given bloodtype is valid

Package Exports

  • bloodtype-validator

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (bloodtype-validator) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme


BLOODTYPE-VALIDATOR


Confirms Value is a Valid Bloodtype

Installation

Build Status

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
});