Test migration to jest by hand
Apparently using regular expressions is way easier.
This commit is contained in:
3
test/truncateString/truncateString.js
Normal file
3
test/truncateString/truncateString.js
Normal file
@ -0,0 +1,3 @@
|
||||
const truncateString = (str, num) =>
|
||||
str.length > num ? str.slice(0, num > 3 ? num - 3 : num) + '...' : str;
|
||||
module.exports = truncateString;
|
||||
Reference in New Issue
Block a user