класс (typescript): 
                  
                  
                  class Section(config: any) {
                  
                  
                    prop1: Section;
                  
                  
                    prop2: number;
                  
                  
                    
                  
                  
                    constructor(parent: Section | any) {
                  
                  
                      if(parent instance of Section) {
                  
                  
                        /// обработка
                  
                  
                      } else {
                  
                  
                        Object.assign(this,parent);
                  
                  
                      }
                  
                  
                    }
                  
                  
                  }
                  
                  
                  
                  
                  
                  let a = new Section({prop1: {prop1: null, prop2: 100}, prop2: 100});
                  
                  
                
Не проверяет тип данных
Обсуждают сегодня