Skip to content

Commit

Permalink
Use split-lines (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
timdp authored and sindresorhus committed Apr 21, 2016
1 parent 5e72818 commit ccb8a53
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
@@ -1,6 +1,7 @@
'use strict';
var splitLines = require('split-lines');
module.exports = function (str, pad) {
return pad ? String(str).split(/\r?\n/).map(function (line) {
return pad ? splitLines(String(str)).map(function (line) {
return line ? pad + line : line;
}).join('\n') : str;
};
3 changes: 3 additions & 0 deletions package.json
Expand Up @@ -25,6 +25,9 @@
"string",
"str"
],
"dependencies": {
"split-lines": "^1.0.0"
},
"devDependencies": {
"mocha": "*"
}
Expand Down

0 comments on commit ccb8a53

Please sign in to comment.