Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
req.keys().forEach(filename => {
const matches = filename.match(/([a-zA-Z]+)\.docs\.tsx?$/);
if (!matches) {
return;
}
const componentName = matches[1];
const stories = storiesOf(componentName, module);
const docs = req(filename).default as ComponentDocs;
if (
docs.storybook === false ||
!docs.examples.some(({ Example }) => typeof Example === 'function')
) {
return;
}
// Only render foundation elements in `wireframe` no need to theme them
const storyThemes = docs.foundation
? values(themes).filter(theme => theme.name === 'wireframe')
: values(themes).filter(theme => theme.name !== 'wireframe');
storyThemes.forEach(theme => {
stories.add(theme.name, () => (