utk-entrepreneur icon indicating copy to clipboard operation
utk-entrepreneur copied to clipboard

Некорректная валидация okpo

Open MrCheater opened this issue 1 year ago • 1 comments

Привет! Нашел ошибку в твоем коде.

Условие del11 === 10 проверяется дважды подряд. summ считается, а потом не используется

https://github.com/utkonos-ru/utk-entrepreneur/blob/main/src/okpo/index.ts

if (del11 === 10) {
    summ = 0;
    for (const i in testingValue.split('')) {
      if (i) summ += Number(testingValue[i]) * (getWeight(Number(i)) + 2);
    }
    del11 = del11 === 10 ? 0 : del11;
  }

MrCheater avatar Mar 14 '23 13:03 MrCheater