var toString       = require('../lang/toString')
var replaceAccents = require('./replaceAccents')
var removeNonWord  = require('./removeNonWord')
var trim           = require('./trim')

// Convert to lower case, remove accents, remove non-word chars and
// replace spaces with the specified delimeter.
// Does not split camelCase text.

function slugify (str, delimeter) {
  str = toString(str)

  if (delimeter == null) delimeter = '-'
  str = replaceAccents(str)
  str = removeNonWord(str)
  str = trim(str) // should come after removeNonWord
    .replace(/ +/g, delimeter) // replace spaces with delimeter
    .toLowerCase()

  return str
}

module.exports = slugify

@@ -1,20 +1,20 @@
 var t
-oString
+rim    
        =
@@ -28,23 +28,57 @@
 e('.
-./lang/toS
+/trim')%0Avar stringify      = require('./s
 tring
+ify
 ')%0Av
@@ -111,25 +111,26 @@
 e('./replace
-A
+-a
 ccents')%0Avar
@@ -168,54 +168,17 @@
 move
-NonWord')%0Avar trim           = require('./trim
+-non-word
 ')%0A%0A
@@ -376,16 +376,17 @@
 r = 
-toS
+s
 tring
+ify
 (str
@@ -429,16 +429,17 @@
 r = '-'%0A
+%0A
   str = 

update string/case-slugify adjust dependencies