Skip to content

Commit

Permalink
make strutils.indent accept indentation width
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonkarns committed Oct 15, 2015
1 parent b59a9eb commit e9c0ff7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/strutils.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ function pad(str, l, s, t){
+ str + s.substr(0, l - t) : str).substring(0, ol)
}

function indent(text){
function indent(text, width){
return text.split('\n').map(function(line){
return ' ' + line
return Array((width||4) + 1).join(' ') + line
}).join('\n')
}

Expand Down

0 comments on commit e9c0ff7

Please sign in to comment.