has-setter

v1.0.0
Checks if an object has a property with a defined setter function.
object property descriptor set setter function check has

has-setter

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

Installation

npm install has-setter --save

The module exposes a single function.

Usage

const hasSetter = require('has-setter')

class Test {
  set data (value) {}
}

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

const test = new Test()

hasSetter(test, 'data') // true
npm i has-setter

Metadata

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

Downloads

Maintainers