🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

collect-property

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

collect-property

Collect property over prototype chain

0.1.1
latest
Source
npm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

collect-property

Build Status Dependency Status devDependency Status

Collect property over prototype chain.

Install

Download manually or with package-manager.

npm

npm install --save collect-property

Example

var collectProperty = require('collect-property');

// Define constructors with following hierarchy: C -> B -> A
var A = function () {
  this.prop = 'baz';
};
var B = function () {
  this.prop = 'bar';
};
B.prototype = new A();
var C = function () {
  this.prop = 'foo';
};
C.prototype = new B();

// Create an instance.
var o = new C();

// Collect all values for the `prop` property.
var values = collectProperty(o, 'prop');
// → ['foo', 'bar', 'baz']

Contributions

Contributions are very welcomed, either on the documentation or on the code.

You may:

  • report any issue you've encountered;
  • fork and create a pull request.

License

ISC © Julien Fontanet

Keywords

chain

FAQs

Package last updated on 16 Jul 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts