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

Version Path
ende-0.4.25 vendor/components/indefinido-observable/components/chaijs-chai/lib/chai/utils/getProperties.js
ende-0.4.25 vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/getProperties.js
ende-0.4.24 vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/getProperties.js
ende-0.4.24 vendor/components/indefinido-observable/components/chaijs-chai/lib/chai/utils/getProperties.js
ende-0.4.23 vendor/components/indefinido-observable/components/chaijs-chai/lib/chai/utils/getProperties.js
ende-0.4.23 vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/getProperties.js
ende-0.5.1 components/indefinido/indemma/master/components/chaijs-chai/lib/chai/utils/getProperties.js
ende-0.4.22 vendor/components/indefinido-observable/components/chaijs-chai/lib/chai/utils/getProperties.js
ende-0.4.22 vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/getProperties.js
ende-0.4.21 vendor/components/indefinido-observable/components/chaijs-chai/lib/chai/utils/getProperties.js
ende-0.4.21 vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/getProperties.js
ende-0.5.0 vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/getProperties.js
ende-0.4.20 vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/getProperties.js
ende-0.4.19 vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/getProperties.js
ende-0.4.18 vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/getProperties.js
ende-0.4.17 vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/getProperties.js
ende-0.4.16 vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/getProperties.js
ende-0.3.13 vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/getProperties.js
ende-0.3.12 vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/getProperties.js
ende-0.3.11 vendor/components/indefinido-indemma/components/chaijs-chai/lib/chai/utils/getProperties.js