diff --git a/index.js b/index.js index 87ca329..53d635e 100644 --- a/index.js +++ b/index.js @@ -6,7 +6,7 @@ const builtinOverridableReplacements = require('./overridable-replacements'); const decamelize = string => { return string // Separate capitalized words. - .replace(/([A-Z]{2,})([a-z\d]+)/g, '$1 $2') + .replace(/([A-Z]{2,})([\d]+)/g, '$1 $2') .replace(/([a-z\d]+)([A-Z]{2,})/g, '$1 $2') .replace(/([a-z\d])([A-Z])/g, '$1 $2') diff --git a/test.js b/test.js index 3e46825..e4f19b9 100644 --- a/test.js +++ b/test.js @@ -23,7 +23,7 @@ test('main', t => { t.is(slugify('foo&bar'), 'foo-and-bar'); t.is(slugify('foo360BAR'), 'foo360-bar'); t.is(slugify('FOO360'), 'foo-360'); - t.is(slugify('FOObar'), 'foo-bar'); + t.is(slugify('FOOBar'), 'foo-bar'); }); test('custom separator', t => {