@chargo/ifhasprop
v1.0.0
Published
if property didn't existed,throw error
Downloads
3
Readme
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