https://github.com/lamansky/has-setter
A Node.js module that checks if an object has a property with a defined setter function.
https://github.com/lamansky/has-setter
Last synced: 3 months ago
JSON representation
A Node.js module that checks if an object has a property with a defined setter function.
- Host: GitHub
- URL: https://github.com/lamansky/has-setter
- Owner: lamansky
- License: mit
- Created: 2017-03-06T07:31:57.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-06T07:44:37.000Z (over 9 years ago)
- Last Synced: 2025-03-04T09:46:38.415Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 1.95 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license.txt
Awesome Lists containing this project
README
# has-setter
A [Node.js](https://nodejs.org/) module that checks if an object has a property with a defined setter function.
## Installation
```bash
npm install has-setter --save
```
The module exposes a single function.
## Usage
```javascript
const hasSetter = require('has-setter')
class Test {
set data (value) {}
}
hasSetter(Test.prototype, 'data') // true
const test = new Test()
hasSetter(test, 'data') // true
```