0.1.0 • Published 6 years ago

access-safe v0.1.0

Weekly downloads
7
License
MIT
Repository
github
Last release
6 years ago

access-safe

Description

A lightweight package that makes dealing with Cannot read property of undefined errors easy in a way that your IDE can understand. You can also specify a default value that will be returned, if the value will be undefined. No strings used.

Usage

import { accessSafe } from 'access-safe';
const { accessSafe } = require('access-safe');
const area = accessSafe(() => user.address.city.area);
const zipCode = accessSafe(() => user.address.zipCode, 90895);