1.0.0 • Published 7 years ago

has-getter v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

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