: number = (a) => {
                  
                  
                      if (typeof a === 'undefined' || a === undefined || a === null) {
                  
                  
                          return '1'
                  
                  
                      }
                  
                  
                      return 1
                  
                  
                  }
                  
                  
                  Promise.resolve().then(
                  
                  
                      Math.random() > 0.5 ?
                  
                  
                          () => { } :
                  
                  
                          () => 1
                  
                  
                  ).then(fn)
                  
                  
                  пишет
                  
                  
                  Type 'string | number' is not assignable to type 'T extends void ? string : number'
                  
                  
                  помогите затипизировать fn, ну или как то сузить тип войда чтоли
                  
                  
                
Напиши перегрузку, это поможет
Обсуждают сегодня