get-prototype

1.0.0 • Public • Published

get-prototype

  • When passed a function, returns its prototype.
  • Throws an error if the prototype is null.
  • When passed an object, assumes it’s a prototype and returns it as-is.

Packaged as a Node.js module.

Installation

npm install get-prototype --save

Usage

const getPrototype = require('get-prototype')
class Test {}
getPrototype(Test) === Test.prototype // true
getPrototype(Test.prototype) === Test.prototype // true

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    2

Package Sidebar

Install

npm i get-prototype

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • lamansky