Allow empty options object for sanitizeSlug
.
This commit is contained in:
parent
716f55cd8e
commit
2b64fbfba6
@ -43,7 +43,7 @@ export function sanitizeIRI(str, { replacement = "" } = {}) {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function sanitizeSlug(str, { replacement = '-' }) {
|
export function sanitizeSlug(str, { replacement = '-' } = {}) {
|
||||||
if (!isString(str)) throw "`sanitizeSlug` only accepts strings as input.";
|
if (!isString(str)) throw "`sanitizeSlug` only accepts strings as input.";
|
||||||
if (!isString(replacement)) throw "the `sanitizeSlug` replacement character must be a string.";
|
if (!isString(replacement)) throw "the `sanitizeSlug` replacement character must be a string.";
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user