class Text {
  toShortText: (text: string, length?: number) => string = (
    text,
    length = 5,
  ) => {
    return text && text.length >= length
      ? `${text.substr(0, length)}...`
      : text;
  };
}

export const text = new Text();
export default text;
