// src/whitespace.ts
function collapseWhitespace(value) {
  return value.replace(/\s+/g, " ").trim();
}
function truncateCodePointSafe(value, maxChars) {
  const glyphs = Array.from(value);
  if (maxChars <= 0) return "";
  if (glyphs.length <= maxChars) return value;
  return glyphs.slice(0, Math.max(1, maxChars)).join("").trimEnd();
}

export {
  collapseWhitespace,
  truncateCodePointSafe
};
//# sourceMappingURL=chunk-6MKAMLQL.js.map