PositiveIntPipe ๋ก value๊ฐ ์๋์ด ๊ฐ๋๋ค.
https://github.com/nestjs/nest/blob/master/packages/common/pipes/parse-int.pipe.ts์ ๋งํฌ๊ฐ ParseIntPipe ๊ตฌํ ์ฝ๋์ธ๋ฐ์!59๋ฒ ๋ผ์ธ์ ๋ณด๋ฉด isNumber ๋ฉ์๋๋ฅผ ํตํด ์ซ์๊ฐ์ธ์ง ์ฒดํฌ๋ฅผ ํ๊ณ ์์ต๋๋ค. ๋ค๋ง, ์ ๊ทํํ์ match ๋ถ๋ถ์ ๋ณด๋ฉด ์์๋ false๊ฐ ๋๋ฏ๋ก exception์ด ๋ฐ์ํ๋๊ฒ ๋ง์ต๋๋ค! ๊ฐ์์์ 2.2๊ฐ ํต๊ณผ๋๋๊ฑฐ๋, ๋ฒ์ ๋ฌธ์ ์ธ๋ฏํฉ๋๋ค!๊ณผ๊ฑฐ์ isNumber ๊ตฌํ์ด ์๋์ ๊ฐ์ด ๋์ด์์๋ ์ ์ด ์์๋ค์!const value ='2.2'; const isNumeric = 'string' === typeof value && !isNaN(parseFloat(value)) && isFinite(value); console.log(isNumberic); // true