Skip to content

Latest commit

 

History

History
41 lines (26 loc) · 648 Bytes

README.template.md

File metadata and controls

41 lines (26 loc) · 648 Bytes

safe-navigation

type(script) and null safe navigation in json objects

get .$

Returns the value or undefined if any value on the path to it is undefined

>>examples/getter.ts

The optional chaining also takes into account union types.

>>examples/unions.ts

set value .$set

Returns a new object with the target set to value if the path to value exists

>>examples/set.ts

map value .$map

Maps the value at end of the path

>>examples/map.ts

map with promises .$pmap

Returns a new object with the target mapped using a promise returning map function

>>examples/pmap.ts