Permalink
Browse files

refactor createSlug()

  • Loading branch information...
1 parent 334cb34 commit 24452846727096104dd4348a2295716ba92895ae @tj tj committed Oct 15, 2012
Showing with 1 addition and 2 deletions.
  1. +1 −2 index.js
View
3 index.js
@@ -246,8 +246,7 @@ Menu.prototype.hide = function(){
*/
function createSlug(str) {
- if (typeof str === 'number') { str = str.toString(); }
- return str
+ return String(str)
.toLowerCase()
.replace(/ +/g, '-')
.replace(/[^a-z0-9-]/g, '');

0 comments on commit 2445284

Please sign in to comment.