# 04 · type-predicates **演示**:`value is User` 让 `filter` 的结果从 `unknown[]` 变成 `User[]`,运行时同时做结构校验。 **运行**:在 `tutorials/typescript` 下执行 `npm run build`,再执行 `npm run serve`,打开 `http://localhost:8080/examples/03-literal-types-narrowing/04-type-predicates/`;开 Console。 **预期控制台输出**: ```text Ada Linus ``` **类型检查**:`node node_modules/typescript/bin/tsc -p examples/03-literal-types-narrowing/04-type-predicates/tsconfig.types.json` **注意**:谓词函数必须真的返回布尔值并与声明一致;TS 不会验证你的判断逻辑。