diff --git a/modules/ve2/ve.js b/modules/ve2/ve.js index ce5aca4357..cc9756a22a 100644 --- a/modules/ve2/ve.js +++ b/modules/ve2/ve.js @@ -97,6 +97,26 @@ ve.getObjectKeys = Object.keys || function( obj ) { return keys; }; +/** + * Gets an array of all property values in an object. + * + * @static + * @method + * @param {Object} Object to get values from + * @returns {Array} List of object values + */ +ve.getObjectValues = function( obj ) { + var values = [], + key, + hop = Object.prototype.hasOwnProperty; + for ( key in obj ) { + if ( hop.call( obj, key ) ) { + values.push( obj[key] ); + } + } + return values; +}; + /** * Recursively compares string and number property between two objects. *