Skip to content

Commit

Permalink
simpler code
Browse files Browse the repository at this point in the history
  • Loading branch information
ndelangen committed Nov 17, 2023
1 parent 07374cc commit ddbb446
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions code/lib/core-server/src/presets/common-override-preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const stories: PresetProperty<'stories', StorybookConfig> = async (entrie
};
})
)
).reduce<StoriesEntry[]>((acc, expanded, i) => {
).flatMap<StoriesEntry>((expanded, i) => {
const filteredEntries = expanded.files.filter((s) => !s.endsWith('.mdx'));
// only return the filtered entries when there is something to filter
// as webpack is faster with unexpanded globs
Expand All @@ -61,14 +61,12 @@ export const stories: PresetProperty<'stories', StorybookConfig> = async (entrie
...expanded,
files: `**/${k}`,
}));
acc.push(...items);
} else {
items = [list[i]];
}
acc.push(...items);

return acc;
}, []);
return items;
});
return result;
}
return entries;
Expand Down

0 comments on commit ddbb446

Please sign in to comment.