1. is-proto-prop
Does a JS type's prototype have a property
is-proto-prop
Package: is-proto-prop
Created by: dustinspecker
Last modified: Sun, 19 Jun 2022 02:48:53 GMT
Version: 2.0.0
License: MIT
Downloads: 726,697
Repository: https://github.com/dustinspecker/is-proto-prop

Install

npm install is-proto-prop
yarn add is-proto-prop

is-proto-prop

NPM version Build Status Coverage Status

Code Climate Dependencies DevDependencies

Does a JS type's prototype have a property

Uses Sindre Sorhus' proto-props

Install

npm install --save is-proto-prop

Usage

ES2015

 import isProtoProp from 'is-proto-prop';

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

isProtoProp('Error', 'ignore');
// => false

// `is-proto-props` can only verify native JS types
isProtoProp('gulp', 'task');
// => false

ES5

 var isProtoProp = require('is-proto-prop');

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

isProtoProp('Error', 'ignore');
// => false

// `is-proto-props` can only verify native JS types
isProtoProp('gulp', 'task');
// => false

API

isProtoProp(type, propertyName)

Returns a Boolean if propertyName is on type's prototype.

type

type: string

JS type to examine the prototype of. Note: is-proto-prop only looks at native JS types.

propertyName

type: string

Property name to look for on type's prototype. Note: propertyName is case sensitive.

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