Comparing version 0.0.6 to 1.0.0
@@ -1,2 +0,2 @@ | ||
var ConsolePos, exports, splitString, | ||
var ConsolePos, ansiRegex, exports, splitString, stringLength, | ||
__slice = [].slice; | ||
@@ -6,4 +6,8 @@ | ||
stringLength = require('string-length'); | ||
ansiRegex = require('ansi-regex')(); | ||
splitString = function(str, length, offset, endsInNL) { | ||
var first, head, min, rest, tail, tmp, _ref; | ||
var escapeArray, first, head, min, rest, tail, tmp, _ref; | ||
if (endsInNL === void 0) { | ||
@@ -14,3 +18,3 @@ endsInNL = str[str.length - 1] === '\n'; | ||
rest = tmp.join("\n"); | ||
if (first.length < length - offset) { | ||
if (stringLength(first) < length - offset) { | ||
if (rest.length === 0) { | ||
@@ -26,3 +30,14 @@ if (endsInNL) { | ||
} else { | ||
min = Math.min(first.length, length - offset); | ||
min = Math.min(stringLength(first), length - offset); | ||
escapeArray = str.match(ansiRegex); | ||
if (escapeArray !== null) { | ||
escapeArray.forEach(function(escape) { | ||
var end, start; | ||
start = str.indexOf(escape); | ||
end = escape.length; | ||
if (min > start && min < end) { | ||
return min += end; | ||
} | ||
}); | ||
} | ||
head = first.substring(0, min); | ||
@@ -29,0 +44,0 @@ tail = first.substring(min, first.length); |
{ | ||
"name": "breakwrap", | ||
"version": "0.0.6", | ||
"version": "1.0.0", | ||
"author": "Mike Groseclose", | ||
@@ -34,3 +34,5 @@ "email": "mike.groseclose@gmail.com", | ||
"dependencies": { | ||
"console-pos": "0.0.3" | ||
"console-pos": "1.0.0", | ||
"string-length": "1.0.0", | ||
"ansi-regex": "1.1.0" | ||
}, | ||
@@ -37,0 +39,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
11449
61
0
3
+ Addedansi-regex@1.1.0
+ Addedstring-length@1.0.0
+ Addedansi-regex@1.1.0(transitive)
+ Addedconsole-pos@1.0.0(transitive)
- Removedansi-regex@1.1.1(transitive)
- Removedconsole-pos@0.0.3(transitive)
Updatedconsole-pos@1.0.0