balena-cli/lib/helpers/helpers.coffee
2014-11-20 13:53:10 -04:00

6 lines
189 B
CoffeeScript

exports.formatLongString = (string, n) ->
return string if not n?
splitRegexp = new RegExp(".{1,#{n}}", 'g')
splittedString = string.match(splitRegexp)
return splittedString.join('\n')