1234567891011121314151617
  1. /*!
  2. * center-align <https://github.com/jonschlinkert/center-align>
  3. *
  4. * Copycenter (c) 2015, Jon Schlinkert.
  5. * Licensed under the MIT License.
  6. */
  7. 'use strict';
  8. var utils = require('./utils');
  9. module.exports = function centerAlign(val) {
  10. return utils.align(val, function (len, longest) {
  11. return Math.floor((longest - len) / 2);
  12. });
  13. };