{"size": 489, "ext": "js", "max_stars_repo_path": "lib/string/centerAlign.js", "max_stars_repo_name": "carlitosz/utils", "max_stars_repo_stars_event_min_datetime": "2015-03-25T08:06:39.000Z", "max_stars_repo_stars_event_max_datetime": "2021-12-10T05:19:15.000Z", "max_issues_repo_path": "lib/string/centerAlign.js", "max_issues_repo_name": "carlitosz/utils", "max_issues_repo_issues_event_min_datetime": "2015-03-25T08:55:13.000Z", "max_issues_repo_issues_event_max_datetime": "2017-08-21T18:23:40.000Z", "max_forks_repo_path": "lib/string/centerAlign.js", "max_forks_repo_name": "carlitosz/utils", "max_forks_repo_forks_event_min_datetime": "2015-03-25T16:56:31.000Z", "max_forks_repo_forks_event_max_datetime": "2021-10-30T00:44:18.000Z"}
{"max_stars_count": 59, "max_issues_count": 7, "max_forks_count": 22, "avg_line_length": 18.8076923077, "max_line_length": 48, "alphanum_fraction": 0.6441717791}
'use strict';

var alignCenter = require('center-align');
var isString = require('./isString');

/**
 * Center align the characters in a string using
 * non-breaking spaces.
 *
 * ```js
 * centerAlign("abc");
 * ```
 *
 * @name .centerAlign
 * @param  {String} `str` The string to reverse.
 * @return {String} Centered string.
 * @related rightAlign
 * @api public
 */

module.exports = function centerAlign(str) {
  if (!isString(str)) return '';
  return alignCenter(str, '&nbsp;');
};

