@reldens/utils 0.20.0 → 0.20.1
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.
- package/lib/shortcuts.js +10 -0
- package/package.json +1 -1
package/lib/shortcuts.js
CHANGED
|
@@ -314,6 +314,16 @@ class Shortcuts
|
|
|
314
314
|
return text;
|
|
315
315
|
}
|
|
316
316
|
|
|
317
|
+
slugify(text)
|
|
318
|
+
{
|
|
319
|
+
return (text || '')
|
|
320
|
+
.replace(/&/g, ' and ')
|
|
321
|
+
.replace(/[^a-zA-Z0-9]/g, ' ')
|
|
322
|
+
.trim()
|
|
323
|
+
.replace(/\s+/g, '-')
|
|
324
|
+
.toLowerCase();
|
|
325
|
+
}
|
|
326
|
+
|
|
317
327
|
}
|
|
318
328
|
|
|
319
329
|
module.exports = new Shortcuts();
|