export class Text { param text { string } param prefix { string } return { string } public static indent ( text , prefix ) { const result = prefix + text ; return result . replace ( /\n/g , `\n${ prefix }` ) ; } public static isWhitespace ( text ) { return /^\s+$/ . test ( text ) ; } param ch { string } param len { number } public static createDuplicateText ( ch , len ) { if ( ch . length !== 1 ) { throw new Error ( "The ch char must be 1 char" ) ; } const arr = new Array ( len ) ; arr . fill ( ch ) ; return arr . join ( "" ) ; } }