const response = {};
setDeepMany(response, [
['status.code', 200],
['status.message', 'OK'],
['data.results', [1, 2, 3]],
['data.total', 3]
]);
// response is now { status: { code: 200, message: 'OK' }, data: { results: [1, 2, 3], total: 3 } }
Sets multiple values deep within a nested object using dot notation paths.
Efficiently sets multiple nested properties in a single call. Each entry is processed sequentially, and if any entry fails, an error is thrown immediately. Use this when you need to initialize or update multiple nested properties at once, such as building configuration objects or setting multiple metrics.