Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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
  • Socket score

Version published
Weekly downloads
1
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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc