Comparing version
{ | ||
"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') | ||
}) | ||
}); |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
18751
1.62%200
2.04%0
-100%118
2.61%