Sha256: e16f3eae265f9ee38ad6f82084c82cd6e1f384cb2dbf537c3f8623fb60e06690
Contents?: true
Size: 771 Bytes
Versions: 100
Compression:
Stored size: 771 Bytes
Contents
/*! * Chai - getProperties utility * Copyright(c) 2012-2013 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} * @name getProperties * @api public */ module.exports = function getProperties(object) { var result = Object.getOwnPropertyNames(subject); function addProperty(property) { if (result.indexOf(property) === -1) { result.push(property); } } var proto = Object.getPrototypeOf(subject); while (proto !== null) { Object.getOwnPropertyNames(proto).forEach(addProperty); proto = Object.getPrototypeOf(proto); } return result; };
Version data entries
100 entries across 68 versions & 1 rubygems