add OpenLayers.Util.upperCaseObject() function and test

git-svn-id: http://svn.openlayers.org/trunk/openlayers@491 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
euzuro
2006-06-01 10:52:22 +00:00
parent 128825886e
commit c7aee7fd25
2 changed files with 50 additions and 1 deletions

View File

@@ -785,6 +785,23 @@ OpenLayers.Util.createAlphaImageDiv = function(id, px, sz, imgURL,
};
/** Creates a new hash and copies over all the keys from the
* passed-in object, but storing them under an uppercased
* version of the key at which they were stored.
*
* @param {Object} object
*
* @returns A new Object with all the same keys but uppercased
* @type Object
*/
OpenLayers.Util.upperCaseObject = function (object) {
var uObject = new Object();
for (var key in object) {
uObject[key.toUpperCase()] = object[key];
}
return uObject;
};
/** Takes a hash and copies any keys that don't exist from
* another hash, by analogy with Object.extend() from
* Prototype.js.