export class DotNotationHelper { public static getValue(path: string, obj: T): T { const pathSplitted: Array = path.split('.'); const property: string | null = pathSplitted.pop() || null; if (!property) { throw new Error(); } return pathSplitted.reduce((x: any, key: string) => x[key], obj)[property]; } public static setValue(path: string, obj: T, value: any): T { const pathSplitted: Array = path.split('.'); const property: string | null = pathSplitted.pop() || null; if (!property) { throw new Error(); } pathSplitted.reduce((x: any, key: string) => x[key], obj)[property] = value; return obj; } }