Get a value using a path of property keys.
Translation keys mapping to locale objects
const locale = { preference: { theme: { label: 'Theme' } }} as const;const text = getByString(locale, 'preference.theme.label'); // 'Theme' Copy
const locale = { preference: { theme: { label: 'Theme' } }} as const;const text = getByString(locale, 'preference.theme.label'); // 'Theme'
Arrays
const pascal = { triangle: [ [1], [1, 1], [1, 2, 1], [1, 3, 3, 1], [1, 4, 6, 4, 1] ]} as const;const row3 = getByString(pascal, 'triangle[3]'); // readonly [1, 3, 3, 1]const r4c3 = getByString(pascal, 'triangle[4][2]'); // 6 Copy
const pascal = { triangle: [ [1], [1, 1], [1, 2, 1], [1, 3, 3, 1], [1, 4, 6, 4, 1] ]} as const;const row3 = getByString(pascal, 'triangle[3]'); // readonly [1, 3, 3, 1]const r4c3 = getByString(pascal, 'triangle[4][2]'); // 6
Get a value using a path of property keys.