From abd94a7f5a50f43c797a11b53549ae48fff667c3 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Mon, 10 Oct 2016 03:43:44 +0200 Subject: add node_modules to address #4364 --- node_modules/indent-string/index.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 node_modules/indent-string/index.js (limited to 'node_modules/indent-string/index.js') diff --git a/node_modules/indent-string/index.js b/node_modules/indent-string/index.js new file mode 100644 index 000000000..4a21687b2 --- /dev/null +++ b/node_modules/indent-string/index.js @@ -0,0 +1,20 @@ +'use strict'; +var repeating = require('repeating'); + +module.exports = function (str, indent, count) { + if (typeof str !== 'string' || typeof indent !== 'string') { + throw new TypeError('`string` and `indent` should be strings'); + } + + if (count != null && typeof count !== 'number') { + throw new TypeError('`count` should be a number'); + } + + if (count === 0) { + return str; + } + + indent = count > 1 ? repeating(indent, count) : indent; + + return str.replace(/^(?!\s*$)/mg, indent); +}; -- cgit v1.2.3