Skip to content

Commit

Permalink
Don't normalize the input string (#28)
Browse files Browse the repository at this point in the history
* Don't normalize the input string

While nifty, and visually it doesn't have an impact. However, when comparing a normalized string to a normal they can differ even though they look the same on the surface. Also, it's not needed for this module to function correctly.

* Remove false positive test
  • Loading branch information
kevva authored and Qix- committed Sep 19, 2019
1 parent adc8438 commit 9df7d27
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const checkAnsi = (ansiCodes, isEscapes, endAnsiCode) => {
};

module.exports = (string, begin, end) => {
const characters = [...string.normalize()];
const characters = [...string];
const ansiCodes = [];

end = typeof end === 'number' ? end : characters.length;
Expand Down

0 comments on commit 9df7d27

Please sign in to comment.