export function get(object: any, path: string[]): any {
    return path.reduce((o, k) => (o || {})[k], object);
}

export function set(object: any, path: string[], value: any): void {
    path.reduce((o, k, i) => {
        if (i === path.length - 1) {
            o[k] = value;
        } else {
            if (o[k] === undefined) {
                o[k] = {};
            }
        }
        return o[k];
    }, object);
}
