https://github.com/lamansky/has-getter
A Node.js module that checks if an object has a property with a defined getter function.
https://github.com/lamansky/has-getter
Last synced: 2 months ago
JSON representation
A Node.js module that checks if an object has a property with a defined getter function.
- Host: GitHub
- URL: https://github.com/lamansky/has-getter
- Owner: lamansky
- License: mit
- Created: 2017-03-06T08:18:15.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-06T08:24:06.000Z (over 9 years ago)
- Last Synced: 2025-01-28T16:45:09.649Z (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-getter
A [Node.js](https://nodejs.org/) module that checks if an object has a property with a defined getter function.
## Installation
```bash
npm install has-getter --save
```
The module exposes a single function.
## Usage
```javascript
const hasGetter = require('has-getter')
class Test {
get data () { return 'example' }
}
hasGetter(Test.prototype, 'data') // true
const test = new Test()
hasGetter(test, 'data') // true
```