Skip to content

Commit 8426fa2

Browse files
committed
satisfy linter
1 parent baeb496 commit 8426fa2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

packages/openapi-typescript/src/transform/schema-object.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ function transformSchemaObjectCore(schemaObject: SchemaObject, options: Transfor
453453
("$defs" in schemaObject && schemaObject.$defs)
454454
) {
455455
// properties
456-
if (Object.keys(schemaObject.properties ?? {}).length) {
456+
if ("properties" in schemaObject && schemaObject.properties && Object.keys(schemaObject?.properties).length) {
457457
for (const [k, v] of getEntries(schemaObject.properties ?? {}, options.ctx)) {
458458
if ((typeof v !== "object" && typeof v !== "boolean") || Array.isArray(v)) {
459459
throw new Error(
@@ -522,7 +522,7 @@ function transformSchemaObjectCore(schemaObject: SchemaObject, options: Transfor
522522
}
523523

524524
// $defs
525-
if (schemaObject.$defs && typeof schemaObject.$defs === "object" && Object.keys(schemaObject.$defs).length) {
525+
if ("$defs" in schemaObject && typeof schemaObject.$defs === "object" && Object.keys(schemaObject.$defs).length) {
526526
const defKeys: ts.TypeElement[] = [];
527527
for (const [k, v] of Object.entries(schemaObject.$defs)) {
528528
const property = ts.factory.createPropertySignature(

0 commit comments

Comments
 (0)