Closed markg85 closed 2 years ago
const { printTable } = require('./dist'); //Create a table const testCases = [ { index: 3, text: 'I would like some gelb bananen bitte', value: 100 }, { index: 4, text: 'I hope batch update is working', value: 300 }, { index: 4, text: 'Unicode.... \uD83C\uDD9E', value: 300 }, ]; //print printTable(testCases);
This might be of interest: https://stackoverflow.com/questions/54369513/how-to-count-the-correct-length-of-a-string-with-emojis-in-javascript
Though the fix likely is [...str].length. Example:
[...str].length
let str = `Unicode.... \uD83C\uDD9E` console.log(str.length) // 14 console.log([...str].length) // 13
This is the same as https://github.com/ayonious/console-table-printer/issues/389 Im open to PRs.
Fixed this in 2.11.1 version
Sweet! :D Thanx!
This might be of interest: https://stackoverflow.com/questions/54369513/how-to-count-the-correct-length-of-a-string-with-emojis-in-javascript
Though the fix likely is
[...str].length
. Example: