Skip to content

Instantly share code, notes, and snippets.

@ghostbar
Created July 23, 2013 07:31
Show Gist options
  • Save ghostbar/6060504 to your computer and use it in GitHub Desktop.
Save ghostbar/6060504 to your computer and use it in GitHub Desktop.
This was asked on angular@googlegroups. Azure servers have the params being case-sensitive and that's anti-consistency for how most people code today. So this is the easier solution using underscore/lodash. The `newObject` will end up with all the keys lowercased.
var search = $location.search();
var newObject = {};
_.each(search, function(value, key) {
newObject[key.toLowercase()] = value;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment