Given a deep-search query path, returns an object property or array value of a JsonCollection as an AnyJson, or the given default if a value was not found or was not type-compatible.
const obj = { foo: { bar: [{ a: 'b' }] } };
const value = getAnyJson(obj, 'foo.bar[1]', { c: 'd' });
// type of value -> AnyJson; value -> { c: 'd' }
Given a deep-search query path, returns an object property or array value of a JsonCollection as an AnyJson, or
undefined
if a value was not found or was not type-compatible.See coerceAnyJson for caveats regarding shallow type detection of
AnyJson
values from untyped sources.