Skip to content

Commit ba052f8

Browse files
committed
add comment translate in assertType
1 parent 2a88219 commit ba052f8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

api/assert-type.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
你可以使用此函数作为 [`expectTypeOf`](/api/expect-typeof) 的替代方法,以轻松地断言参数类型等于提供的泛型。
66

77
::: warning
8-
在运行时,此函数不执行任何操作。要 [enable typechecking](/guide/testing-types#run-typechecking),不要忘记传递 `--typecheck` 标志。
8+
在运行时,此函数不执行任何操作。要 [启用 typechecking](/guide/testing-types#run-typechecking),不要忘记传递 `--typecheck` 标志。
99
:::
1010

1111
```ts
@@ -17,6 +17,6 @@ function concat(a: string | number, b: string | number): string | number
1717

1818
assertType<string>(concat('a', 'b'))
1919
assertType<number>(concat(1, 2))
20-
// @ts-expect-error wrong types
20+
// @ts-expect-error 错误类型
2121
assertType(concat('a', 2))
2222
```

0 commit comments

Comments
 (0)