Safety First
Safe nested lookups with simple tagged template syntax
This library aims to enable safe nested lookups in manner similar to lodash/get and other such libraries but uses Tagged template literals to provide an alternate syntax.
Usage
// use whatever alias you likeconst g = ; const target = foo: bar: baz: 'quux' corge: 'grault' ; // mirrors basic lookup functionalityg`.foo.bar.baz` === 'quux'g`[foo].bar.baz` === 'quux'g`['foo'].bar.baz` === 'quux' // normally target.waldo.fred would have thrown an errorg`.waldo.fred` === undefined // interpolation const bar = 'bar';g`.foo..baz` === 'quux'g`.foo[].baz` === 'quux' // array lookupsg`.foo.bar.corge[0]` === 'grault'