Skip to content
Snippets Groups Projects
Unverified Commit 64b960b6 authored by y.takahashi's avatar y.takahashi Committed by GitHub
Browse files

Handle Surrogate Pairs in truncate() (#25148)

parent 11b83364
No related branches found
No related tags found
No related merge requests found
......@@ -166,8 +166,9 @@ const makeMapStateToProps = () => {
};
const truncate = (str, num) => {
if (str.length > num) {
return str.slice(0, num) + '';
const arr = Array.from(str);
if (arr.length > num) {
return arr.slice(0, num).join('') + '';
} else {
return str;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment