Various functions for working with ANSI strings. E.g. when measuring the width of an ANSI string you don't want to include any of the command characters, only those that are displayed in the terminal.
Add the specified string to the right side of your String so that it's the specified length. If this is impossible, e.g. in padRight 10 "🌈" "hello" the 🌈 is 2 columns wide meaning that your result will be either 9 or 11 columns wide, then white space will be added to fill the remaining space.
Remove ANSI characters from a String. Mostly useful for things like measuring a String's width.
Matches ANSI characters
Borrowed from https://github.com/chalk/ansi-regex
Matches emojis
Borrowed from https://github.com/mathiasbynens/emoji-regex
With the removal of: ©®‼⁉™ℹ↔-↙↩↪⌨⏏⏭-⏯⏱⏲⏸-⏺Ⓜ▪▫▶◀◻◼◾☀-☄☎☑☘☠☢☣☦☪☮☯☸-☺♀♂-♟♠♣♥♦♨♻♾⚒⚔-⚗⚙⚛⚜⚠⚧⚰⚱⛈⛏⛑⛩⛰-⛷⛸✂✉✏✒✔✖✝✡✳✴❄❇❣➡
Measures the width of a
Stringin terminal columns.Copied from https://github.com/sindresorhus/string-width/blob/main/index.js