1. is-get-set-prop
Does a JS type have a getter/setter property
is-get-set-prop
Package: is-get-set-prop
Created by: dustinspecker
Last modified: Sun, 19 Jun 2022 02:41:55 GMT
Version: 1.0.0
License: MIT
Downloads: 725,635
Repository: https://github.com/dustinspecker/is-get-set-prop

Install

npm install is-get-set-prop
yarn add is-get-set-prop

is-get-set-prop

NPM version Build Status Coverage Status

Code Climate Dependencies DevDependencies

Does a JS type have a getter/setter property

Install

npm install --save is-get-set-prop

Usage

ES2015

 import isGetSetProp from 'is-get-set-prop';

isGetSetProp('array', 'length');
// => true

isGetSetProp('ARRAY', 'push');
// => false

// is-get-set-prop can only verify native JS types
isGetSetProp('gulp', 'task');
// => false;

ES5

 var isGetSetProp = require('is-get-set-prop');

isGetSetProp('array', 'length');
// => true

isGetSetProp('ARRAY', 'push');
// => false

// is-get-set-prop can only verify native JS types
isGetSetProp('customObject', 'customGetterOrSetter');
// => false;

API

isGetSetProp(type, propertyName)

type

Type: string

A native JS type to examine. Note: is-get-set-prop can only verify native JS types.

propertyName

Type: string

Property name to determine if a getter/setter of type.

LICENSE

MIT © Dustin Specker

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code