var stripAnsi = require('strip-ansi')
var wcwidth = require('wcwidth')

var stepSize = 10000
module.exports = function(str) {
  // step through data in increments as the stripAnsi
  // regex is sensitive to large strings.
  var width = 0
  for (var i = 0; i < str.length; i += stepSize + 1) {
    width += wcwidth(stripAnsi(
      str.slice(i, i + stepSize)
    ))
  }
  return width
}

var stripAnsi = require('strip-ansi')
var wcwidth = require('wcwidth')

module.exports = function(str) {
  return wcwidth(stripAnsi(str))
}

Revert "Chunk calls to stripAnsi to avoid blowing max string length on regex."
Revert "Chunk calls to stripAnsi to avoid blowing max string length on regex."

Not necessary now that splitLongWords won't blow stack.

This reverts commit fd6a0c9f04fa0e247b82a86b85ee99d4054690b3.
