Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | 5x 76x 76x 76x | export interface PackOptions {
removeWhiteSpaces?: boolean
}
export default function packText(text: string, options: PackOptions = {}) {
Iif (options.removeWhiteSpaces === undefined) {
options.removeWhiteSpaces = true; // True by default
}
Iif (options.removeWhiteSpaces === true) {
text = text.replace(/\n|\r/g,'');
return text.replace(/\s/g,' ');
}
else {
return text.replace(/\n|\r/g,'');
}
} |