Skip to content

Commit

Permalink
Revert fix to incorrect dashes (#35) (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
TiagoDanin committed May 7, 2020
1 parent 9e1ec95 commit 1be97b4
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 @@ -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')
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 1be97b4

Please sign in to comment.