Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const stylesRegexp = /export const styles.*[\r\n](.*[\r\n])*};[\r\n][\r\n]/;
const styleRegexp = /\/\* (.*) \*\/[\r\n]\s*(\w*)/g;
// Extract the styles section from the source
const stylesSrc = stylesRegexp.exec(styleSrc);
if (stylesSrc) {
// Extract individual classes and descriptions
stylesSrc[0].replace(styleRegexp, (match, desc, key) => {
styles.descriptions[key] = desc;
});
}
}
let reactAPI;
try {
reactAPI = docgenParse(src, null, defaultHandlers.concat(muiDefaultPropsHandler), {
filename: componentObject.filename,
});
} catch (err) {
console.log('Error parsing src for', componentObject.filename);
throw err;
}
reactAPI.name = name;
reactAPI.styles = styles;
reactAPI.pagesMarkdown = pagesMarkdown;
reactAPI.src = src;
reactAPI.spread = spread;
reactAPI.EOL = getLineFeed(src);
const testInfo = await parseTest(componentObject.filename);
// no Object.assign to visually check for collisions
handlers: componentPath =>
defaultHandlers.concat(dnHandler.createDisplayNameHandler(componentPath))
};
module.exports = rootPath => {
return defaultHandlers.concat([markdownHandler(rootPath)]);
};