JFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbr{ gilour

File "slugify-string.ts"

Full Path: /home/markqprx/iniasli.pro/client/utils/string/slugify-string.ts
File size: 489 bytes
MIME-type: text/plain
Charset: utf-8

import slugify from 'slugify';

export function slugifyString(
  text: string,
  replacement = '-',
  strict = false
): string {
  if (!text) return text;
  let slugified = slugify(text, {
    lower: true,
    replacement,
    strict,
    remove: /[*+~.()'"!:@?\|/\\]/g,
  });
  // some chinese text might not get slugified properly,
  // just replace whitespace with dash in that case
  if (!slugified) {
    slugified = text.replace(/\s+/g, '-').toLowerCase();
  }
  return slugified;
}