3 module.exports = (string, count = 1, options) => {
6 includeEmptyLines: false,
10 if (typeof string !== 'string') {
12 `Expected \`input\` to be a \`string\`, got \`${typeof string}\``
16 if (typeof count !== 'number') {
18 `Expected \`count\` to be a \`number\`, got \`${typeof count}\``
22 if (typeof options.indent !== 'string') {
24 `Expected \`options.indent\` to be a \`string\`, got \`${typeof options.indent}\``
32 const regex = options.includeEmptyLines ? /^/gm : /^(?!\s*$)/gm;
34 return string.replace(regex, options.indent.repeat(count));