New:Microsoft Teams Notifications Are Now Available in Socket.Learn more →
Get Started

@chargo/ifhasprop

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@chargo/ifhasprop

if property didn't existed,throw error

Source
npmnpm
Version
0.1.3-0
Version published
Maintainers
1
Created
Source

hasProp

check if property has existed, if didn't throw TypeError.

import { hasProp } from 'ifhasprop';

const obj = hasProp({
  name: 'hi'
});

obj.name // undefined
obj.age // throw error

FAQs

Package last updated on 16 Dec 2021

Related posts