Skip to content

Commit a6e8c84

Browse files
committed
Fix complexity/useLiteralKeys
Signed-off-by: Sora Morimoto <[email protected]>
1 parent 946a594 commit a6e8c84

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/schema-parser/schema-parser.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -213,10 +213,7 @@ class SchemaParser {
213213
this.schema = { type: this.config.Ts.Keyword.Null };
214214
}
215215
// schema is response schema
216-
if (
217-
"content" in this.schema &&
218-
typeof this.schema["content"] === "object"
219-
) {
216+
if ("content" in this.schema && typeof this.schema.content === "object") {
220217
const schema = this.extractSchemaFromResponseStruct(this.schema);
221218
const schemaParser = this.schemaParserFabric.createSchemaParser({
222219
schema,

src/schema-parser/schema-utils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ class SchemaUtils {
3333
};
3434

3535
isRefSchema = (schema) => {
36-
return !!schema?.["$ref"];
36+
return !!schema?.$ref;
3737
};
3838

3939
getEnumNames = (schema) => {
4040
return (
4141
schema["x-enumNames"] ||
42-
schema["xEnumNames"] ||
42+
schema.xEnumNames ||
4343
schema["x-enumnames"] ||
4444
schema["x-enum-varnames"]
4545
);

0 commit comments

Comments
 (0)