Skip to content

Commit 27b17dd

Browse files
committed
Merge pull request #1 from lordvlad/master
allow empty string indents
2 parents bd4417a + ded55ff commit 27b17dd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ module.exports = function(str, options) {
1414
}
1515

1616
var width = options.width || 50;
17-
var indent = options.indent || ' ';
17+
var indent = (typeof options.indent === 'undefined') ? ' ' : options.indent;
1818
var newline = options.newline || '\n' + indent;
1919

2020
var re = new RegExp('.{1,' + width + '}(\\s|$)|\\S+?(\\s|$)', 'g');
2121
return indent + str.match(re).join(newline);
22-
};
22+
};

0 commit comments

Comments
 (0)