uslug
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -1,1 +0,1 @@ | ||
module.exports = require('./lib/slugify'); | ||
module.exports = require('./lib/uslug'); |
@@ -31,8 +31,8 @@ (function() { | ||
if (val) { | ||
if ('LN'.indexOf(val) != -1) rv.push(c); | ||
if ('Z'.indexOf(val) != -1) rv.push(' '); | ||
if (~'LN'.indexOf(val)) rv.push(c); | ||
if (~'Z'.indexOf(val)) rv.push(' '); | ||
} | ||
} | ||
slug = rv.join('').replace(/^\s+|\s+$/g, '').replace(/\s+/g,' '); | ||
if (!spaces) slug = slug.replace(/\s+/g,'-').replace(/-+/g,'-'); | ||
if (!spaces) slug = slug.replace(/[\s\-]+/g,'-'); | ||
if (lower) slug = slug.toLowerCase(); | ||
@@ -39,0 +39,0 @@ return slug; |
{ | ||
"name" : "uslug", | ||
"version" : "1.0.0", | ||
"version" : "1.0.1", | ||
"description" : "A permissive slug generator that works with unicode.", | ||
@@ -5,0 +5,0 @@ "author": "Jeremy Selier <jerem.selier@gmail.com>", |
@@ -35,7 +35,6 @@ # Uslug.js | ||
* string - The string you want to slugify. | ||
* options - An optional object that can contain: | ||
allowedChars: a String of chars that you want to be whitelisted. | ||
Default: '-_~'. | ||
lower: a Boolean to force to lower case the slug. Default: true. | ||
spaces: a Boolean to allow spaces. Default: false. | ||
* options - An optional object that can contain: | ||
* allowedChars: a String of chars that you want to be whitelisted. Default: '-_~'. | ||
* lower: a Boolean to force to lower case the slug. Default: true. | ||
* spaces: a Boolean to allow spaces. Default: false. | ||
@@ -42,0 +41,0 @@ |
112810
43