/*!
 * @techmely/utils
 * Copyright(c) 2021-2024 Techmely <techmely.creation@gmail.com>
 * MIT Licensed
 */


// src/truncate/index.ts
function truncate(str, limit, text = "...") {
  if (str.length > limit) {
    return `${str.substring(0, limit)} ${text}`;
  }
  return str;
}

export { truncate };
