'use strict'

module.exports = trimTrailingLines

var line = '\n'

// Remove final newline characters from `value`.
function trimTrailingLines(value) {
  var string = String(value)
  var index = string.length

  while (string.charAt(--index) === line) {
    // Empty
  }

  return string.slice(0, index + 1)
}

'use strict'

module.exports = trimTrailingLines

// Remove final newline characters from `value`.
function trimTrailingLines(value) {
  return String(value).replace(/\n+$/, '')
}

Refactor code to improve bundle size
Refactor code to improve bundle size
