Skip to content

Valentin1918/safe-get-prop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

safe-get-prop

A function, which safely returns a property on any nested object layer

Usage:

import { safeGetProp } from 'safe-get-prop';
const myObj = { prop1: { prop2: { prop3: 123 } } };
const ensureValue = 'nothing to show';
safeGetProp(myObj, 'prop1.prop2.prop3', ensureValue);

safe-get-prop

About

A function, which safely returns a property on any nested object layer

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published