UNPKG

@techmely/utils

Version:

Collection of helpful JavaScript / TypeScript utils

19 lines (14 loc) 387 B
'use strict'; /*! * @techmely/utils * Copyright(c) 2021-2024 Techmely <techmely.creation@gmail.com> * MIT Licensed */ // src/slugify.ts function slugify(text) { if (!text) { return ""; } return text.toString().normalize("NFKD").toLowerCase().trim().replace(/\s+/g, "-").replace(/[Đđ]/g, "d").replace(/[^\w-]+/g, "").replace(/--+/g, "-"); } exports.slugify = slugify;