lib/generate-report.js
function _isBase64(string) {
    const notBase64 = /[^A-Z0-9+\/=]/i;
    const stringLength = string.length;

    if (!stringLength || stringLength % 4 !== 0 || notBase64.test(string)) {
      return false;
    }

    const firstPaddingChar = string.indexOf('=');

    return firstPaddingChar === -1 ||
      firstPaddingChar === stringLength - 1 ||
      (firstPaddingChar === stringLength - 2 && string[stringLength - 1] === '=');
  }
function _isBase64(string) {
    const notBase64 = /[^A-Z0-9+\/=]/i;
    const stringLength = string.length;

    if (!stringLength || stringLength % 4 !== 0 || notBase64.test(string)) {
      return false;
    }

    const firstPaddingChar = string.indexOf('=');

    return firstPaddingChar === -1 ||
      firstPaddingChar === stringLength - 1 ||
      (firstPaddingChar === stringLength - 2 && string[stringLength - 1] === '=');
  }
function _isBase64 ( string ) { const notBase64 = / [^A-Z0-9+\/=] / i ; const stringLength = string . length ; if ( ! stringLength || stringLength % 4 !== 0 || notBase64 . test ( string ) ) { return false ; } const firstPaddingChar = string . indexOf ( '=' ) ; return firstPaddingChar === - 1 || firstPaddingChar === stringLength - 1 || ( firstPaddingChar === stringLength - 2 && string [ stringLength - 1 ] === '=' ) ; }
Check if the string a base64 string
@param string
@return {boolean}
@private
Check if the string a base64 string