mongoose-url-slugs
Advanced tools
Comparing version 0.0.6 to 0.0.7
var extend = require('extend'); | ||
function defaultURLSlugGeneration(text, separator) { | ||
return text.toLowerCase().replace(/([^a-z0-9\-\_]+)/g, separator).replace(new RegExp(separator + '{2,}', 'g'), separator); | ||
var slug = text.toLowerCase().replace(/([^a-z0-9\-\_]+)/g, separator).replace(new RegExp(separator + '{2,}', 'g'), separator); | ||
if (slug.substr(-1) == seperator) { | ||
slug = slug.substr(0, slug.length-1); | ||
} | ||
return slug; | ||
} | ||
@@ -6,0 +10,0 @@ |
@@ -9,3 +9,3 @@ { | ||
"description": "Create URL compatiable slugs on mongoose models, ensuring uniqueness.", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"keywords": [ | ||
@@ -12,0 +12,0 @@ "mongoose slugs", |
@@ -67,2 +67,3 @@ # Mongoose URL Slugs | ||
* v0.0.7 (2014-06-10) -- slug generation improved. | ||
* v0.0.6 (2014-06-10) -- incremented slug generation bug fix and minor optimizations. | ||
@@ -69,0 +70,0 @@ * v0.0.5 (2014-06-10) -- Initial release. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8765
93
94