Skip to content

hien11dev/template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

REMOVE Vietnamese Tones

function removeVietnameseTones(text) {
  return text.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
}

SLUG

function slug(text) {
  return text.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase().replace(/[^\w\s]/gi, "").replace(/\s+/, '-');
}

Giới hạn text

function limitWordCount(text, limit) {
  let words = text.trim().split(/\s+/);
  if (limit < words.length) {
    return words.slice(0, limit).join(' ') + '...';
  }
  return text;
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published