🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@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

latest
Source
npmnpm
Version
1.0.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

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts