Socket
Socket
Sign inDemoInstall

get-prototype-chain

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

get-prototype-chain

Returns an array of the object's prototype chain


Version published
Weekly downloads
54K
increased by5.34%
Maintainers
1
Weekly downloads
 
Created
Source

get-prototype-chain Build Status

Returns an array with the passed in object's prototype chain (in ascending order).

Install

npm install --save get-prototype-chain

Usage

const getPrototypeChain = require('get-prototype-chain');

class A {

}

class B extends A {

}

class C extends B {

}

var obj = new C();

getPrototypeChain(obj).map(x => x.constructor.name)

// returns ['C', 'C', 'B', 'A', 'Object']

Keywords

FAQs

Package last updated on 15 Sep 2015

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