Utility to safely access values on a deeply nested structure. If path doesn't exist, return the default value.
const result1 = dataGet([{key:{prop:1}}], '0.key.prop') // 1;const result2 = dataGet([{key:{prop:1}}], '*.key.prop') // [1]; Copy
const result1 = dataGet([{key:{prop:1}}], '0.key.prop') // 1;const result2 = dataGet([{key:{prop:1}}], '*.key.prop') // [1];
the structure to search.
the path to the value delimited by '.'
'.'
Optional
the value to return if the path doesn't exist.
Generated using TypeDoc
Utility to safely access values on a deeply nested structure. If path doesn't exist, return the default value.
Example