Skip to content

Commit

Permalink
CSF-tools: Allow type checking in storySort
Browse files Browse the repository at this point in the history
  • Loading branch information
honzahruby committed Dec 20, 2023
1 parent bf498ea commit 1d520ad
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion code/lib/csf-tools/src/getStorySortParameter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ const getValue = (obj: t.ObjectExpression, key: string) => {
return value;
};

const parseValue = (expr: t.Expression): any => {
const parseValue = (value: t.Expression): any => {
const expr = stripTSModifiers(value);

if (t.isArrayExpression(expr)) {
return (expr.elements as t.Expression[]).map((o) => {
return parseValue(o);
Expand Down

0 comments on commit 1d520ad

Please sign in to comment.