//#region src/util/text.ts
/**
* Truncates a string to a maximum length, adding an ellipsis (...) if truncated.
* @param str The string to truncate
* @param maxLen The maximum length of the resulting string, including the ellipsis
* @returns The truncated string, with ellipsis if necessary
*/
function ellipsize(str, maxLen) {
	if (str.length > maxLen) return str.slice(0, maxLen - 3) + "...";
	return str;
}
/**
* Escapes special regex characters in a string.
* Use this when building regex patterns from dynamic input to prevent ReDoS attacks.
*/
function escapeRegExp(str) {
	return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
}
//#endregion
export { escapeRegExp as n, ellipsize as t };

//# sourceMappingURL=text-CFa1rdK5.js.map