추론 타입 프레디킷
filter 등에서 타입 좁히기가 자동으로 동작합니다.
const arr = [1, null, 2, undefined, 3];
// TypeScript 5.5 — 자동으로 number[]로 추론
const numbers = arr.filter(x => x !== null && x !== undefined);
// type: number[]정규식 검사
// TypeScript가 정규식 문법 오류를 검사
const re = /(?<name>\w+) (?<age>\d+)/;
// 잘못된 정규식은 컴파일 에러 발생격리된 선언
--isolatedDeclarations 옵션으로 병렬 .d.ts 생성이 가능해집니다.
댓글 0