Sha256: 0da54f92a4d6f212dedba4149fecd9838fdef798c81b595ac9c7a53260e8f8a8
Contents?: true
Size: 789 Bytes
Versions: 6
Compression:
Stored size: 789 Bytes
Contents
/*! * Chai - getProperties utility * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com> * MIT Licensed */ /** * ### .getProperties(object) * * This allows the retrieval of property names of an object, enumerable or not, * inherited or not. * * @param {Object} object * @returns {Array} * @namespace Utils * @name getProperties * @api public */ module.exports = function getProperties(object) { var result = Object.getOwnPropertyNames(object); function addProperty(property) { if (result.indexOf(property) === -1) { result.push(property); } } var proto = Object.getPrototypeOf(object); while (proto !== null) { Object.getOwnPropertyNames(proto).forEach(addProperty); proto = Object.getPrototypeOf(proto); } return result; };
Version data entries
6 entries across 6 versions & 5 rubygems