Skip to content

Commit

Permalink
Prefer satisfies over as
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperpeulen committed May 31, 2023
1 parent 6f50175 commit 642a42f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions code/lib/docs-tools/src/argTypes/docgen/PropDef.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

export interface JsDocParam {
name: string | undefined | null;
description?: string;
description?: string | null;
}

export interface JsDocReturns {
description?: string;
description?: string | null;
}

export interface JsDocTags {
params?: JsDocParam[];
returns?: JsDocReturns;
returns?: JsDocReturns | null;
}

export interface PropSummaryValue {
Expand Down
4 changes: 2 additions & 2 deletions code/lib/docs-tools/src/argTypes/docgen/createPropDef.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,11 @@ function applyJsDocResult(propDef: PropDef, jsDocParsingResult?: JsDocParsingRes
name: x.getPrettyName(),
description: x.description,
})),
};
} satisfies JsDocTags;

if (Object.values(value).filter(Boolean).length > 0) {
// eslint-disable-next-line no-param-reassign
propDef.jsDocTags = value as JsDocTags;
propDef.jsDocTags = value;
}
}

Expand Down

0 comments on commit 642a42f

Please sign in to comment.