import { TransformerFunction } from './TransformerFunction';

/**
 * Converts an existing Boolean value to a Human Readable format.
 * @param bool Boolean value to be converted
 */
export const formatBoolean: TransformerFunction<boolean, string> = (
  bool,
): string => {
  const str = String(bool);

  if (str !== '') {
    return str[0].toUpperCase().concat(str.substr(1));
  }

  return '';
};
