Comparing version 2.0.0 to 2.0.1
27
index.js
@@ -87,3 +87,11 @@ 'use strict'; | ||
return wrap(stripAnsi(message), maxLength, {hard: true}) | ||
const strippedMessage = stripAnsi(message); | ||
const spacesIndex = []; | ||
strippedMessage.split(' ').reduce((accu, cur) => { | ||
spacesIndex.push(accu + cur.length); | ||
return spacesIndex[spacesIndex.length - 1] + 1; | ||
}, 0); | ||
return wrap(strippedMessage, maxLength, {hard: true}) | ||
.split(/\n/) | ||
@@ -97,8 +105,19 @@ .reduce((greeting, str, index, array) => { | ||
let offset = 0; | ||
for (let i = 0; i < spacesIndex.length; i++) { | ||
let char = completedString[spacesIndex[i] - offset]; | ||
if (char) { | ||
if (char !== ' ') { | ||
offset += 1; | ||
} | ||
} else { | ||
break; | ||
} | ||
} | ||
str = completedString | ||
.substr(completedString.length - str.length) | ||
.replace(/./g, (char, charIndex) => { | ||
if (index > 0) { | ||
charIndex += completedString.length - str.length + index; | ||
} | ||
charIndex += completedString.length - str.length + offset; | ||
@@ -105,0 +124,0 @@ let hasContinuedStyle = 0; |
{ | ||
"name": "yosay", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Tell Yeoman what to say", | ||
@@ -5,0 +5,0 @@ "license": "BSD-2-Clause", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9335
178
1