Skip to content

Commit 63450a0

Browse files
committed
fix underscored method for single letter worlds
1 parent e622437 commit 63450a0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

underscored.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
var trim = require('./trim');
22

33
module.exports = function underscored(str) {
4-
return trim(str).replace(/([a-z\d])([A-Z]+)/g, '$1_$2').replace(/[-\s]+/g, '_').toLowerCase();
4+
return trim(str).replace(/([a-z\d])([A-Z]+)/g, '$1_$2').replace(/([A-Z\d]+)([A-Z][a-z])/,'$1_$2').replace(/[-\s]+/g, '_').toLowerCase();
55
};

0 commit comments

Comments
 (0)