/* eslint-disable no-param-reassign */
const ENVIRONMENTS = require('../../../constants/environments');

function createEnvironmentFilter(options) {
  const environmentName = options.buildtype;

  return (files, metalsmith, done) => {
    for (const fileName of Object.keys(files)) {
      const file = files[fileName];

      if (environmentName !== ENVIRONMENTS.LOCALHOST) {
        if (file.draft) delete files[fileName];
      }

      if (file[environmentName] === false) {
        delete files[fileName];
      }
    }
    done();
  };
}

module.exports = createEnvironmentFilter;

@@ -391,14 +391,39 @@
 ile.
+status === '
 draft
+'
 )
+ %7B%0A         
  del
@@ -435,32 +435,42 @@
 iles%5BfileName%5D;%0A
+        %7D%0A
       %7D%0A%0A      i

Change draft to status (#9773)