function doHideCreditCards(text) {
  if (hideCreditCards) {
    return text.replace(/[0-9]{14,19}/g, (match) => {
      return luhnCheck(match)
        ? '<<POTENTIAL CREDIT CARD REDACTED>>'
        : match;
    });
  } else {
    return text;
  }
}
/**
 * Hide anything that looks like a credit card
 * Perform a luhn check to reduce some false positives
 */
Hide anything that looks like a credit card
Perform a luhn check to reduce some false positives
Hide anything that looks like a credit card Perform a luhn check to reduce some false positives
function doHideCreditCards(text) {
  if (hideCreditCards) {
    return text.replace(/[0-9]{14,19}/g, (match) => {
      return luhnCheck(match)
        ? '<<POTENTIAL CREDIT CARD REDACTED>>'
        : match;
    });
  } else {
    return text;
  }
}
function doHideCreditCards ( text ) { if ( hideCreditCards ) { return text . replace ( / [0-9]{14,19} / g , ( match ) => { return luhnCheck ( match ) ? '<<POTENTIAL CREDIT CARD REDACTED>>' : match ; } ) ; } else { return text ; } }
Hide anything that looks like a credit card
 Perform a luhn check to reduce some false positives
Hide anything that looks like a credit card Perform a luhn check to reduce some false positives