Skip to content

Commit

Permalink
docs(zh): 检查器 -> 拦截器
Browse files Browse the repository at this point in the history
  • Loading branch information
so1ve committed Apr 16, 2024
1 parent d8cffb3 commit 2af5b66
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/.vitepress/config/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const zhConfig = defineConfig({
link: "/zh/commands",
},
{
text: "检查器",
text: "拦截器",
link: "/zh/interceptors",
},
{
Expand Down
14 changes: 7 additions & 7 deletions docs/zh/interceptors.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
---
title: 检查器
title: 拦截器
---

# 检查器
# 拦截器

检查器是在调用命令处理程序之前或之后运行的函数,类似于 koa 中的中间件。
拦截器是在调用命令处理程序之前或之后运行的函数,类似于 koa 中的中间件。

## 用法

可以使用 `interceptor` 方法将检查器添加到命令行界面 (CLI) 中:
可以使用 `interceptor` 方法将拦截器添加到命令行界面 (CLI) 中:

```ts
import { Clerc } from "clerc";
Expand Down Expand Up @@ -53,9 +53,9 @@ const cli = Clerc.create()

因此,执行顺序如下:

1. 预检查器(Pre interceptors)
2. 正常检查器(Normal interceptors)
3. 后检查器(Post interceptors)
1. 预拦截器(Pre interceptors)
2. 正常拦截器(Normal interceptors)
3. 后拦截器(Post interceptors)

## 在命令处理程序之后调用

Expand Down

0 comments on commit 2af5b66

Please sign in to comment.