Skip to content

Commit

Permalink
fix: remove shorthand prop if undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
atanasster committed Mar 17, 2021
1 parent a30e237 commit e1234d8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions core/instrument/src/babel/extract-arguments-usage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const addArgumentUsage = (
story: Story,
args: StoryArguments,
node: any,
shorthand: boolean,
shorthand?: boolean,
): ArgUsageLocation | undefined => {
const param = findArguments(args, node.name);

Expand All @@ -48,7 +48,10 @@ export const addArgumentUsage = (
p.loc.end.line === loc.end.line &&
p.loc.end.column === loc.end.column,
);
const usage: ArgUsageLocation = { loc, shorthand };
const usage: ArgUsageLocation = { loc };
if (shorthand) {
usage.shorthand = shorthand;
}
if (!existing) {
param.usage.push(usage);
return usage;
Expand Down

0 comments on commit e1234d8

Please sign in to comment.