hierarchical-estimates-visu.../lib/stringManipulations.js
NunoSempere 6f91849e4e feat: Get prototype working.
Display still missing, but some core functionality already
works.
2022-06-24 21:38:07 -04:00

12 lines
246 B
JavaScript

export const cutOffLongNames = (string) => {
let maxLength = 40;
let result;
if (string.length < maxLength) {
result = string;
} else {
result = string.slice(0, maxLength - 4);
result = result + "...";
}
return result;
};