UNPKG

text-aligner

Version:

Align text by adding spaces to each string so that all strings have the same number of English and Chinese characters.

10 lines (8 loc) 295 B
type CharWidthRule = { test: RegExp | ((char: string) => boolean); width: number; placeholder?: string; }; type PaddingMap = Record<string, CharWidthRule>; declare function alignText(strings: string[], paddingMap?: PaddingMap, placeholder?: string): string[]; export { alignText };