chai
Version:
BDD/TDD assertion library for node.js and the browser. Test framework agnostic.
26 lines (23 loc) • 527 B
JavaScript
/*!
* Chai - getEnumerableProperties utility
* Copyright(c) 2012-2013 Jake Luer <jake@alogicalparadox.com>
* MIT Licensed
*/
/**
* ### .getEnumerableProperties(object)
*
* This allows the retrieval of enumerable property names of an object,
* inherited or not.
*
* @param {Object} object
* @returns {Array}
* @name getEnumerableProperties
* @api public
*/
module.exports = function getEnumerableProperties(object) {
var result = [];
for (var name in object) {
result.push(name);
}
return result;
};