just-prune
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -19,3 +19,4 @@ module.exports = prune; | ||
var remnantPlusOne = str.slice(0, Math.max(0, length - end.length) + 1); | ||
return remnantPlusOne.slice(0, remnantPlusOne.lastIndexOf(' ') || 0) + end; | ||
var lastSpace = Math.max(0, remnantPlusOne.lastIndexOf(' ')); | ||
return remnantPlusOne.slice(0, lastSpace) + end; | ||
} |
{ | ||
"name": "just-prune", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "prune a string with whole words and a custom suffix", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
1615
19