docs(devkit): fixed typo in executor doc

This commit is contained in:
Eric Jeker 2021-02-03 01:24:19 +08:00 committed by GitHub
parent 7037254911
commit a1043e5629
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -298,8 +298,8 @@ The executor's schema describe the inputs--what you can pass into it.
"description": "Message to echo" "description": "Message to echo"
}, },
"upperCase": { "upperCase": {
"description": "Covert to all upper case",
"type": "boolean", "type": "boolean",
"description": "Covert to all upper case",
"default": false "default": false
} }
}, },
@ -307,7 +307,7 @@ The executor's schema describe the inputs--what you can pass into it.
} }
``` ```
The schema above defines two fields: `message` and `allCaps`. The `message` field is a string, `upperCase` is a boolean. The schema support for executors and generators is identical, so see the section on generators above for more information. The schema above defines two fields: `message` and `upperCase`. The `message` field is a string, `upperCase` is a boolean. The schema support for executors and generators is identical, so see the section on generators above for more information.
### Implementation ### Implementation
@ -318,14 +318,14 @@ Most of the time executors return a promise.
```typescript ```typescript
interface Schema { interface Schema {
message: string; message: string;
allCaps: boolean; upperCase: boolean;
} }
export default async function printAllCaps( export default async function printAllCaps(
options: Schema, options: Schema,
context: ExecutorContext context: ExecutorContext
): Promise<{ success: true }> { ): Promise<{ success: true }> {
if (options.allCaps) { if (options.upperCase) {
console.log(options.message.toUpperCase()); console.log(options.message.toUpperCase());
} else { } else {
console.log(options.message); console.log(options.message);