Sha256: 0f3d6c1db80fb7d79fc65149f6d92172349126054d7365ace6253d44f4e3f151
Contents?: true
Size: 771 Bytes
Versions: 8
Compression:
Stored size: 771 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} * @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
8 entries across 8 versions & 1 rubygems