mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
Add _.uncamelcase
This commit is contained in:
@@ -93,6 +93,10 @@ _.mixin
|
||||
else
|
||||
"-"
|
||||
|
||||
uncamelcase: (string) ->
|
||||
result = string.replace /([A-Z])|(_)/g, (m, letter, underscore) -> " " + letter
|
||||
_.capitalize(result)
|
||||
|
||||
undasherize: (string) ->
|
||||
string.split('-').map(_.capitalize).join(' ')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user