test/browser/validid.umd.js
/**
  Validate ID card number of Taiwan
  @module core/twid
  @param {string} id
  @return {boolean}

  Original name: National Identification Card of the Republic of China
  Format of card id: A123456789

  There is another system called Taiwan Resident Certificate (Uniform ID Numbers)
  @see module:core/twrc
  */
Validate ID card number of Taiwan
Validate ID card number of Taiwan
function twid (id) {
    var isFormatValid; 
    isFormatValid = function isFormatValid(id) {
      return /^[A-Z][12][0-9]{8}$/.test(id);
    };
    id = normalize(id); 
    return isFormatValid(id) && isTwidChecksumValid(id, 1);
  }
function twid ( id ) { var isFormatValid ; isFormatValid = function isFormatValid ( id ) { return / ^[A-Z][12][0-9]{8}$ / . test ( id ) ; } ; id = normalize ( id ) ; return isFormatValid ( id ) && isTwidChecksumValid ( id , 1 ) ; }
Validate ID card number of Taiwan
Validate ID card number of Taiwan
// isLengthValid = (id) -> id.length is 10 // return isLengthValid(id) and isFormatValid(id) and isChecksumValid(id, 1)