Socket
Socket
Sign inDemoInstall

uslug

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

uslug - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

16

lib/uslug.js

@@ -27,9 +27,13 @@ (function() {

// See: http://www.unicode.org/versions/Unicode6.0.0/ch12.pdf - Table 12-2
if (0x4E00 <= code && code <= 0x9FFF) rv.push(c);
if (allowedChars.indexOf(c) != -1) rv.push(c);
if (0x4E00 <= code && code <= 0x9FFF) {
rv.push(c);
continue;
}
if (allowedChars.indexOf(c) != -1) {
rv.push(c);
continue;
}
var val = _unicodeCategory(code);
if (val) {
if (~'LN'.indexOf(val)) rv.push(c);
if (~'Z'.indexOf(val)) rv.push(' ');
}
if (val && ~'LN'.indexOf(val)) rv.push(c);
if (val && ~'Z'.indexOf(val)) rv.push(' ');
}

@@ -36,0 +40,0 @@ slug = rv.join('').replace(/^\s+|\s+$/g, '').replace(/\s+/g,' ');

{
"name" : "uslug",
"version" : "1.0.1",
"version" : "1.0.2",
"description" : "A permissive slug generator that works with unicode.",

@@ -5,0 +5,0 @@ "author": "Jeremy Selier <jerem.selier@gmail.com>",

@@ -27,3 +27,4 @@ var should = require('should'),

['เแโ|ใไ', 'เแโใไ'],
['日本語ドキュメンテ(ーション)', '日本語ドキュメンテーション']
['日本語ドキュメンテ(ーション)', '日本語ドキュメンテーション'],
['一二三四五六七八九十!。。。', '一二三四五六七八九十']
];

@@ -34,2 +35,4 @@

uslug(test[0]).should.equal(test[1]);
}
}
uslug('qbc,fe', { allowedChars: 'q' }).should.equal('qbcfe');
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc