Skip to content

Commit

Permalink
refactor(feature-toggle): Shorten the toggle function for in progress…
Browse files Browse the repository at this point in the history
… components
  • Loading branch information
ryanoglesby08 committed Aug 17, 2017
1 parent ec76c46 commit 827da41
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions config/styleguide.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,11 @@ const path = require('path');

const version = require('../package.json').version;

const toggle = (path) => {
const env = process.env.NODE_ENV;
const toggle = (path) => (
process.env.NODE_ENV === 'production' ? undefined : path
);

if (env === 'production') {
return undefined;
}

return path;
};

const compact = (array) => array.filter((element) => element !== undefined );
const compact = (array) => array.filter((element) => element !== undefined);


module.exports = {
Expand Down

0 comments on commit 827da41

Please sign in to comment.