2 var repeating = require('repeating');
4 module.exports = function (str, indent, count) {
5 if (typeof str !== 'string' || typeof indent !== 'string') {
6 throw new TypeError('`string` and `indent` should be strings');
9 if (count != null && typeof count !== 'number') {
10 throw new TypeError('`count` should be a number');
17 indent = count > 1 ? repeating(indent, count) : indent;
19 return str.replace(/^(?!\s*$)/mg, indent);