@react-pakistan/util-functions 1.24.47 → 1.24.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,7 +12,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.slugify = void 0;
13
13
  var slugify = function (str) { return str
14
14
  .replaceAll(/[’|&;$%@"<>/()+,:?]/gm, '')
15
- .toLowerCase()
16
- .split(' ')
17
- .join('-'); };
15
+ .normalize('NFD') // normalize accented characters
16
+ .replace(/[\u0300-\u036f]/g, '') // remove accents
17
+ .replace(/[^a-zA-Z0-9\s-]/g, '') // remove special chars except spaces & hyphens
18
+ .trim() // trim leading/trailing spaces
19
+ .replace(/\s+/g, '-') // replace spaces with -
20
+ .replace(/-+/g, '-') // collapse multiple hyphens
21
+ .toLowerCase(); };
18
22
  exports.slugify = slugify;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-pakistan/util-functions",
3
- "version": "1.24.47",
3
+ "version": "1.24.48",
4
4
  "description": "A library of all util functions",
5
5
  "main": "index.js",
6
6
  "scripts": {