Skip to content

Commit

Permalink
Revert fix to incorrect dashes (sindresorhus#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
TiagoDanin committed Feb 16, 2020
1 parent 948a828 commit 3e1f521
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,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')
Expand Down
2 changes: 1 addition & 1 deletion test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down

0 comments on commit 3e1f521

Please sign in to comment.