We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents bd4417a + ded55ff commit 27b17ddCopy full SHA for 27b17dd
index.js
@@ -14,9 +14,9 @@ module.exports = function(str, options) {
14
}
15
16
var width = options.width || 50;
17
- var indent = options.indent || ' ';
+ var indent = (typeof options.indent === 'undefined') ? ' ' : options.indent;
18
var newline = options.newline || '\n' + indent;
19
20
var re = new RegExp('.{1,' + width + '}(\\s|$)|\\S+?(\\s|$)', 'g');
21
return indent + str.match(re).join(newline);
22
-};
+};
0 commit comments