12 lines
470 B
JavaScript
Raw Permalink Normal View History

2025-06-21 23:30:33 +03:00
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.truncateMiddle = void 0;
const truncateMiddle = (text, startChars, endChars) => {
if (text.length <= startChars + endChars)
return text;
const start = text.substring(0, startChars);
const end = text.substring(text.length - endChars, text.length);
return `${start}…${end}`;
};
exports.truncateMiddle = truncateMiddle;
//# sourceMappingURL=truncateMiddle.js.map