Skip to content

Commit

Permalink
fix(getStorySortParameters.ts): in getStorySortParameter, decl.init m…
Browse files Browse the repository at this point in the history
…ust be defined
  • Loading branch information
usrrname committed May 1, 2023
1 parent 13793a3 commit ef5206b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion code/lib/csf-tools/src/getStorySortParameter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export const getStorySortParameter = (previewCode: string) => {
node.declaration.declarations.forEach((decl) => {
if (t.isVariableDeclarator(decl) && t.isIdentifier(decl.id)) {
const { name: exportName } = decl.id;
if (exportName === 'parameters') {
if (exportName === 'parameters' && decl.init) {
const paramsObject = stripTSModifiers(decl.init);
storySort = parseParameters(paramsObject);
}
Expand Down

0 comments on commit ef5206b

Please sign in to comment.