15 lines
474 B
JavaScript
15 lines
474 B
JavaScript
/*
|
|
* Copyright (C) Sapphirecode - All Rights Reserved
|
|
* This file is part of appreports which is released under GPL-3.0-or-later.
|
|
* See file 'LICENSE' for full license details.
|
|
* Created by Timo Hocker <timo@scode.ovh>, August 2020
|
|
*/
|
|
|
|
export function resolve_data (set, index) {
|
|
const keys = typeof index === 'string' ? index.split ('/') : index;
|
|
const data = set[keys[0]];
|
|
if (keys.length === 1)
|
|
return data;
|
|
return resolve_data (data, keys.slice (1));
|
|
}
|