has-getter

v1.0.0
Checks if an object has a property with a defined getter function.
object property descriptor get getter function check has

has-getter

A Node.js module that checks if an object has a property with a defined getter function.

Installation

npm install has-getter --save

The module exposes a single function.

Usage

const hasGetter = require('has-getter')

class Test {
  get data () { return 'example' }
}

hasGetter(Test.prototype, 'data') // true

const test = new Test()

hasGetter(test, 'data') // true
npm i has-getter

Metadata

  • MIT
  • Whatever
  • John Lamansky
  • released 3/6/2017

Downloads

Maintainers