1//Example of Typescript static class equivalent
2export abstract class Tools {
3 public static truncate(str, length) {
4 var ending = '...';
5 if (str.length > length) {
6 return str.substring(0, length - ending.length) + ending;
7 } else {
8 return str;
9 }
10 };
11}