Skip to content

Commit

Permalink
Make Codacy happy
Browse files Browse the repository at this point in the history
  • Loading branch information
jy95 committed Dec 19, 2019
1 parent 7fc89a9 commit ecab41f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/framework/index.ts
Expand Up @@ -71,7 +71,9 @@ export class OpenAPIFramework {
};
}

private loadSpec(filePath: string | object, $refParser: { mode: 'bundle' | 'dereference' } = { mode: 'bundle'}): Promise<OpenAPIV3.Document> {
private loadSpec(
filePath: string | object,
$refParser: { mode: 'bundle' | 'dereference' } = { mode: 'bundle' }): Promise<OpenAPIV3.Document> {
// Because of this issue ( https://github.com/APIDevTools/json-schema-ref-parser/issues/101#issuecomment-421755168 )
// We need this workaround ( use '$RefParser.dereference' instead of '$RefParser.bundle' ) if asked by user
if (typeof filePath === 'string') {
Expand All @@ -86,7 +88,7 @@ export class OpenAPIFramework {
fs.readFileSync(absolutePath, 'utf8'),
{ json: true },
);
return ($refParser.mode === "bundle") ? $RefParser.bundle(docWithRefs) : $RefParser.dereference(docWithRefs);
return ($refParser.mode === 'bundle') ? $RefParser.bundle(docWithRefs) : $RefParser.dereference(docWithRefs);
} finally {
process.chdir(origCwd);
}
Expand All @@ -96,7 +98,7 @@ export class OpenAPIFramework {
);
}
}
return ($refParser.mode === "bundle") ? $RefParser.bundle(filePath) : $RefParser.dereference(filePath);
return ($refParser.mode === 'bundle') ? $RefParser.bundle(filePath) : $RefParser.dereference(filePath);
}

private copy<T>(obj: T): T {
Expand Down
2 changes: 1 addition & 1 deletion src/framework/types.ts
Expand Up @@ -363,7 +363,7 @@ interface OpenAPIFrameworkArgs {
apiDoc: OpenAPIV3.Document | string;
validateApiDoc?: boolean;
$refParser?: {
mode: 'bundle' | 'dereference'
mode: 'bundle' | 'dereference',
};
}

Expand Down

0 comments on commit ecab41f

Please sign in to comment.