Update .gitlab-ci.yml file Update .gitlab-ci.yml file Update .gitlab-ci.yml file Update .gitlab-ci.yml file Update .gitlab-ci.yml file localazy script Update .gitlab-ci.yml file Update .gitlab-ci.yml file RED-7497: TS compile error localazy debug RED-7497: file import path localazy test localazy test localazy test localazy test localazy test localazy test
17 lines
423 B
TypeScript
17 lines
423 B
TypeScript
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);
|
|
}
|