lib/utils/assertType.js
function assertString(attr, data) {
  if (data === null || data === undefined) {
    return null;
  }

  if (typeof data !== 'string') {
    throw new ParseError(`Attribute ${attr} must be of type "string"`);
  }

  return data;
}
function assertString(attr, data) {
  if (data === null || data === undefined) {
    return null;
  }

  if (typeof data !== 'string') {
    throw new ParseError(`Attribute ${attr} must be of type "string"`);
  }

  return data;
}
function assertString ( attr , data ) { if ( data === null || data === undefined ) { return null ; } if ( typeof data !== 'string' ) { throw new ParseError ( ` ${ attr } ` ) ; } return data ; }
Throws if the provided data is not a string
Returns the unmodified data if validated

@throws
@param {string} attr - tested attribute name
@param {*} data
@return {null|string}
Throws if the provided data is not a string Returns the unmodified data if validated