Simple safe json path
Usage
;// orconst safepath = ;
safepath(object, path, defaultValue?);
;; const obj = a: b: c: 3 ;let value = ; ; value = ; // also works with numbers in arraysconst arr = 3; value = ; ; // orvalue = ; ; // a default can be provided if an object key is not available:value = ; // if no default value is supplied `null` will be returnedvalue = ; ;
Licence
MIT