npm.io
1.0.0 • Published 9 years ago

get-prototype

Licence
MIT
Version
1.0.0
Deps
1
Vulns
0
Weekly
0

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

Keywords