diff --git a/index.js b/index.js index a9826e2..d7b570b 100644 --- a/index.js +++ b/index.js @@ -11,6 +11,7 @@ module.exports = (str, options) => { if (typeof str !== 'string') throw new TypeError('expected a string'); return str.trim() .replace(/([a-z])([A-Z])/g, '$1-$2') + .replace(/(\d+)/g, m => options && options.splitOnDigits ? `-${m}-` : m) .replace(/\W/g, m => /[À-ž]/.test(m) ? m : '-') .replace(/^-+|-+$/g, '') .replace(/-{2,}/g, m => options && options.condense ? '-' : m)