Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const createStoriesOf = ({ storybook, React, ...config }) => (...args) => {
// if (DEBUG) console.log('storiesOf');
const res = storybook.storiesOf(...args);
if (config.notes) {
res.addDecorator(require('@storybook/addon-notes').withNotes);
}
if (config.backgrounds) {
res.addDecorator(require('@storybook/addon-backgrounds').default(config.backgrounds));
}
// if (config.info) {
if (false) {
res._add = res.add; // eslint-disable-line no-underscore-dangle
res.add = (...args2) => {
if (DEBUG) console.log('res.add');
if (res.inAdd) {
return res._add(...args); // eslint-disable-line no-underscore-dangle
}
res.inAdd = true;
const result = res.addWithInfo ? res.addWithInfo(...args2) : res._add(...args2); // eslint-disable-line no-underscore-dangle
res.inAdd = false;
return result;
};