Skip to content

Commit fbca009

Browse files
author
William Duncan
committed
remove unused parameters
1 parent ba9416f commit fbca009

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

gen/docs.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export function generateDocSchema (schema: Schema, config: Config, pkg: Package)
6363
}
6464
// make operations into methods
6565
const operationMethods = operations.map(operation => {
66-
const returns = {type: getReturnType(operation, schema, config), description: getReturnDescription(operation, schema, config)};
66+
const returns = {type: getReturnType(operation, schema, config), description: getReturnDescription(operation)};
6767
const throws = getThrows(operation, schema, config).map(type => ({type}));
6868
const pathParams = Object.entries(operation.parameters.path ?? {}).map(([name, parameter]) => new DocSchema.Parameter(name, parameter.type, parameter.description, parameter.required, parameter.default));
6969
const queryParams = Object.entries(operation.parameters.query ?? {}).map(([name, parameter]) => new DocSchema.Parameter(name, parameter.type, parameter.description, parameter.required, parameter.default));
@@ -233,8 +233,8 @@ export function generateMarkdownDocs (config: Config, schema: Schema, docSchema:
233233
export async function generateReadme (docMD: string, config: Config, pkg: Package): Promise<void> {
234234
const template = await fs.readFile("README.template.md", "utf8");
235235
// check if project builds successfully
236-
const buildStatus = await new Promise((resolve, reject) => {
237-
child_process.exec("npm run build", (error, stdout, stderr) => {
236+
const buildStatus = await new Promise((resolve) => {
237+
child_process.exec("npm run build", (error) => {
238238
resolve(!error);
239239
});
240240
});

gen/source.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export default async (schema: Schema, config: Config, pkg: Package) => {
4444
const operations: FlatOperation[] = [];
4545
for (const [name, operation] of input) {
4646
const returnType = getReturnType(operation, schema, config);
47-
const returnDescription = getReturnDescription(operation, schema, config);
47+
const returnDescription = getReturnDescription(operation);
4848
const toFlatParam = ([name, parameter]: [string, Schema.Operation.Parameter]): NamedParameter => {
4949
const ts = `${name}${!parameter.required && !parameter.default ? "?: " : ": "}${parameter.type}${parameter.default ? ` = ${parameter.default}` : ""}`;
5050
return {name, ts, ...parameter};

gen/util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export function getReturnType(operation: Schema.Operation, schema: Schema, confi
1919
* @param config
2020
* @returns The combined return description
2121
*/
22-
export function getReturnDescription(operation: Schema.Operation, schema: Schema, config: Config): string {
22+
export function getReturnDescription(operation: Schema.Operation): string {
2323
return operation.returns.filter(r => r.status >= 200 && r.status < 300 && r.description).map(r => r.description).join(" ");
2424
}
2525

0 commit comments

Comments
 (0)