Any value to query.
The query path.
Given a deep-search query path, returns an object property or array value of an object or array as an instance of
class type C
, or undefined
if a value was not found or was not type-compatible.
class Example { ... }
const obj = { foo: { bar: [new Example()] } };
const value = getInstance(obj, 'foo.bar[0]', Example);
// type of value -> Example; value -> new Example()
Given a deep-search query path, returns an object property or array value of an object or array as an instance of class type
C
, orundefined
if a value was not found or was not type-compatible.