New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

sluggo

Package Overview
Dependencies
Maintainers
13
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sluggo - npm Package Compare versions

Comparing version

to
1.0.0

2

package.json
{
"name": "sluggo",
"version": "0.3.1",
"version": "1.0.0",
"description": "High-speed, unicode-aware, browser-friendly slug generator",

@@ -5,0 +5,0 @@ "main": "sluggo.js",

@@ -93,2 +93,5 @@ # sluggo

### 1.0.0 - 2023-05-03
- Accepts an array of exceptions in the `allow` options property while still accepting a string. Declared stable.
### 0.3.1 - 2021-04-23

@@ -95,0 +98,0 @@ - Accepts the empty string as a legitimate value for `def`, as was always intended, rather than forcing `none` in that situation. If `def` is not set at all `none` is still the fallback default.

@@ -36,3 +36,3 @@ var _sluggoRanges;

bad = false;
if ((options.allow !== undefined) && (options.allow === s.charAt(i))) {
if ((options.allow !== undefined) && (options.allow.includes(s.charAt(i)))) {
// Make an exception

@@ -39,0 +39,0 @@ } else {

@@ -28,3 +28,3 @@ var assert = require("assert");

});
it('Fallback default is none', function() {
it('fallback default is none', function() {
var s = sluggo('@#(*&@', {});

@@ -37,3 +37,3 @@ assert.strictEqual(s, 'none');

});
it('Empty string can be passed as default', function() {
it('empty string can be passed as default', function() {
var s = sluggo('@#(*&@', { def: '' });

@@ -46,2 +46,6 @@ assert.strictEqual(s, '');

});
it('allows an array of exceptions', function () {
var s = sluggo("/@/slug url", { allow: ['/', '@'] })
assert.strictEqual(s, '/@/slug-url')
})
});