Skip to content

Commit

Permalink
Merge pull request #2 from kolber/master
Browse files Browse the repository at this point in the history
Regular expression simplification, removes 4 lines
  • Loading branch information
Ben Smithett committed Apr 29, 2014
2 parents ef82fee + a95c00d commit 7dcedf2
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions viewloader.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@
}(this, function(viewloader,$) {
"use strict";
var dasherize = function(s) {
var r = /([a-z0-9][A-Z])/g,
dash = function(m) {
return m[0] + '-' + m[1].toLowerCase();
};
return s.replace(r, dash);
return s.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
};
viewloader.execute = function(views, $scope) {
for(var view in views) {
Expand Down

0 comments on commit 7dcedf2

Please sign in to comment.